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

Javascript Form Question by jmartinASSE 2005-03-08 13:21:49
So I'm using some javascript for the first time ever in an online form. Basically just to make sure the required field is filled in. My problem being the submit, I think.

input type="submit" value="Submit Now" name="submit" onClick="ReadData()"

So when I click the "Submit Now" button, it's running the function to make sure the field is filled in, but then it's going to the submit page anyway. How do I make it stop on the current page?

Not sure if it helps at all, but here's the function...

function verify() {
var regform=(document.reg);
var temp=(regform.Template);

if ((temp.value)==0) {
alert("Please select a template");
temp.value.focus();
temp.value.select();
}
}
[ Reply ]
  Try by Pic2005-03-08 13:26:22
    No! That will fail by Didactylos2005-03-08 13:28:59
    Whats the command to submit a form... by OnDemand2005-03-08 13:30:03
      I haven't the slightest clue what the command is by jmartinASSE2005-03-08 13:33:01
      Yes by staticsan2005-03-08 13:47:56
        with you...kind of by jmartinASSE2005-03-08 13:54:17
  return false? by Didactylos2005-03-08 13:26:51
  "return false;" is needed. by shorty822006-11-19 12:55:59

 

[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.)