Feedback on: irt.org FAQ Knowledge Base Q169
Worth:
Not worth reading
Comments:
the code is messed up...not working!
The name "myObject" should be "myForm"...but even after corrections - still not working!
Not submitting form.......
Worth:
Very worth reading
Length:
Too short
Technical:
Just right
Comments:
irt.org rocks my world. This particular article was *the* key to my completing a desired task.
Although, being the JavaScript novice that I am, it took me a while to realize that "myobject" was referring to the name of the object I wanted to validate (sounds silly in hindsight).
This article, along w/ another (forgot the #) and comp.lang.javascript were very helpful.
Keep it up.
Worth:
Very worth reading
Comments:
Just wanted to say that the code worked great. Thanx for the help.
Comments:
I did this...see if you can use it for something...
<html>
<head>
<title>Validator</title>
<script language="JavaScript">
function validateForm(validator)
{
for (var i = 0; i < validator.elements.length; i++)
{
if (validator.elements[i].value == "")
{
alert("Fill out ALL fields please.")
return false
}
}
return true
}
function formValidated(validator)
{
if (validateForm(validator))
validator.submit()
}
</head>
<body>
<form name="validator" onSubmit="return validateForm(validator)">
Please enter all requested information:
<br>
First name:<input type="text" name="firstname"><br>
Last name:<input type="text" name="lastname"><br>
Rank:<input type="text" name="rank"><br>
Serial Number:<input type="text" name="serialnumber"><br>
<a style="cursor:hand;text-decoration:underline;color:blue;" onClick="formValidated(validator)">Submit</a>
<input type="submit">
</form>
</body>
</html>