gcook1
11-09-2005, 08:25 AM
I have a ASP form that's giving me fits! I have a question on the form ("Have all lines on this sales order shipped complete?") with YES/NO radio buttons. If the user chooses NO, when the submit button is clicked I want a pop up window saying "Form may not be submitted until order is completely shipped". I can't get it to work. Here's my code:
The question coding:
<tr><td colspan=2><%= QUESTION10 %></td>
<td><input type="radio" name="Answer10" value="Yes">Yes
<input type="radio" name="Answer10" value="No">No </td></tr>
<%= QUESTION10%> gets the wording for the question from a CONST set above the html.
The message box coding:
<script language="VBScript">
dim validation
function MyForm_OnSubmit
validation = True
If(document.MyForm.Answer10.Value) = "No" Then
MsgBox("Form may not be submitted until order is completely shipped")
validation = False
End If
If validation = True Then
MyForm_OnSubmit = True
Else
MyForm_OnSubmit = False
End if
end Function
</script>
Any ideas why it doesn't work? Or is there a better way to do this?
Thanks for your help!
The question coding:
<tr><td colspan=2><%= QUESTION10 %></td>
<td><input type="radio" name="Answer10" value="Yes">Yes
<input type="radio" name="Answer10" value="No">No </td></tr>
<%= QUESTION10%> gets the wording for the question from a CONST set above the html.
The message box coding:
<script language="VBScript">
dim validation
function MyForm_OnSubmit
validation = True
If(document.MyForm.Answer10.Value) = "No" Then
MsgBox("Form may not be submitted until order is completely shipped")
validation = False
End If
If validation = True Then
MyForm_OnSubmit = True
Else
MyForm_OnSubmit = False
End if
end Function
</script>
Any ideas why it doesn't work? Or is there a better way to do this?
Thanks for your help!