Forum Moderators: open
This page is saved as "hello.html" and I need it to be submitted to "accept.lasso" when the form is valid.....I'm not sure how to do that part.
<html>
<head>
<script type="text/javascript">
function checkRIC(value)
{
var pattern = /[0][1-7]/
var result = value.match(pattern)
if (result == null) {
alert("The RIC: " + value + " was not Valid! Result was: " + result)
return false
}
}
function checkName(name)
{
var pattern = /^[a-zA-Z]{2,}$/
var result = name.match(pattern)
if (result == null) {
alert("The name: " + name + " was not Valid! Result was: " + result)
return false
}
}
function validate(form)
{
checkName(form.name_first.value)
checkName(form.name_last.value)
checkRIC(form.ric.value)
}
</script>
</head>
<body>
<form action="hello.html" name="form" id="form" method="post" enctype="text/plain" onSubmit="return validate(this)">
<table>
<tr>
<th>First name</th>
<td><input type="text" id="name_first" name="name_first"/></td>
</tr>
<tr>
<th>Last name</th>
<td><input type="text" id="name_last" name="name_last"/></td>
</tr>
<tr>
<th>RIC</th>
<td><select name="ric">
<option value="" selected="selected">Choose RIC...</option>
<option value="01">Alameda</option>
<option value="02">Butte</option>
<option value="03">Imperial</option>
<option value="04">Los Angeles</option>
<option value="05">Sacramento</option>
<option value="06">San Diego</option>
<option value="07">San Joaquin</option>
</select></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="-add" value="Login" /></td>
</tr>
</table>
</form>
</body>
</html>
Little help please...
--Nick
if you want the form to submit to "accept.lasso", then set action="accept.lasso"