RecipeDan
asked on
Checkbox Validation
Hello:
What I am trying to do is submit the form. However if the ValueTextBox is less then or equal to 5 the form should not be submitted until the checkbox is checked.
<head>
<script type = text/vbscript>
Function theForm_onSubmit
If Document.theForm.ValueText Box.Value <= "5" Then
MsgBox "Please select a response!"
theForm_OnSubmit = False
Else
If Document.theForm.ValueText Box.Value <= "5" AND Document.theForm.Ques.chec ked Then
theForm_OnSubmit = True
End If
End Function
</script>
</head>
<body>
<form method="POST" name="theForm" action="abc.asp">
<input type="checkbox" name="Ques" value="Hi"><input type="text" name="ValueTextBox" size="20" value="<%=Request("NumValu e")%>">
<input type="submit" value="Submit" name="B1">
</form>
</body>
What I am trying to do is submit the form. However if the ValueTextBox is less then or equal to 5 the form should not be submitted until the checkbox is checked.
<head>
<script type = text/vbscript>
Function theForm_onSubmit
If Document.theForm.ValueText
MsgBox "Please select a response!"
theForm_OnSubmit = False
Else
If Document.theForm.ValueText
theForm_OnSubmit = True
End If
End Function
</script>
</head>
<body>
<form method="POST" name="theForm" action="abc.asp">
<input type="checkbox" name="Ques" value="Hi"><input type="text" name="ValueTextBox" size="20" value="<%=Request("NumValu
<input type="submit" value="Submit" name="B1">
</form>
</body>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Function theForm_onSubmit
If Document.theForm.ValueText
theForm_OnSubmit = True
Else
If Document.theForm.ValueText
MsgBox "Please select a response!"
theForm_OnSubmit = False
End If
End Function
OM Gang