You are here: irt.org | About | Feedback | 2719 [ previous next ]
Feedback on:
irt.org FAQ Knowledge Base Q169
Sent by
Christian Denny Petersen on May 11, 2001 at 07:05:50:
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>
Other feedback on 'irt.org FAQ Knowledge Base Q169' - show all