The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Still can't get this damn Java to work! Anybody? by jmartinASSE 2005-03-08 15:24:28
Trying to check the form for valid fields before submitting. But, when I click submit, it runs the function, finds the error, displays the alert, but continues through to the next page. Can anybody help? Here are the main portions of the code.

Javascript -
function verify() {
var document=(window.document);
var regform=(document.reg);

if ((document.reg.template.value)== 0) {
alert("Please select a template");
document.reg.template.value.focus();
return false;
}
else {
return true;
}
}


body -
form name="reg" action="cgi-bin/formmail.pl" method="post" onSubmit="return verify()"


select name="template">
option value="0" selected>choose one</option
option value="1">Template #1</option
option value="2">Template #2</option
option value="3">Template #3</option


<input type="submit" name="submit" value="Submit">


To see the actual page it's at http://www.asse.org/chapterhosting
[ Reply ]
  It's Javascript not Java (n/t) by rfrovarp2005-03-08 16:15:13
  the "actual page" link doesn't work by Freakazoid2005-03-08 16:52:18
  Try this instead. by andyz2005-03-08 16:54:57

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)