hcl-bot
September 1, 2004, 2:31pm
1
I have a form that is filled out on the web.
When the user clicks on the submit button I would like a pop-up box come up telling the user what fields he missed to fill in. I think that this would be done in javascript but I do not know javascript. Could someone please give me some example code and let me know where the code goes.
Thanks for you help.
hcl-bot
September 1, 2004, 3:38pm
2
Subject: Validation
In the OnSubmit of the form put return validate() and in the JS Header of the form put code similar the example below.
function validate() {
errMSG = “”
if (document.forms[0].Field1.value == ‘’){
errMSG += “Please fill in Field 1 \n”;
}
if (document.forms[0].Field2.value == ‘’){
errMSG += “Please fill in Field 2 \n”;
}
if (errMSG != “”) {
alert(errMSG);
return false
}
}
hcl-bot
September 1, 2004, 8:22pm
3
Subject: Validation
I’ve created a common validation Casinonic Australia – how to get much pleasure?
the example html
the javascript file
You don’t have to change the js file, just look at the validate.html file source to see how to use it.
William
Casinonic is one of the representatives of new online gambling clubs. It is the place where winners play. A great choice of entertainment for any gambler. Find slots, table games, and even live dealers’ games.
hcl-bot
September 1, 2004, 3:39pm
4
Subject: Validation
Stan,Check out this url: http://www.globalrph.com/davescripts/validate.htm
There is also one here, but it is a little more complicated: JavaScript Programming
I like this one here because it has many different field emails and how to validate each one:
http://www.shiningstar.net/articles/articles/javascript/javascriptvalidations.asp?ID=ROLLA
I used this one when I was first starting out to do javascript validation.
HTH