View Full Version : Check to see if fields are filled help
Ok i got fields that are required to fill in, what would be the code if i wanted it to say a message if those wernt filled when they click submit???
Also how do i make it sos that in the email field u must have @, and . in it?
Thankz!!
chrismiceli
12-01-2002, 05:03 AM
beetle, another member has a program on his site called fvalidate, it is in his sig, look for it. you are going to give us code, but for the e-mail, try this
document.formname.inputname.value = test;
if (test.indexOf("@") == -1) {
alert("empty field")
}
i think that should work, haven't used indexOf() in a while.
so wait, heres my page http://www.geocities.com/unreallegacy/index2.html how would i add it to that page???
Ya i know ewwww geocities :P
Hello all you expert people :thumbsup:
:rolleyes:
Jeepers
12-01-2002, 01:05 PM
Within the form tag put onSubmit="return function-name()" function-name being the name of the function that contains the script.
You might also want to take a look at this thread http://www.codingforums.com/showthread.php?s=&threadid=10767
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.