|
-
Oct 3rd, 2000, 12:12 PM
#1
Thread Starter
Member
Hi, I have <method=post action=script.asp> in my form html page. But I have a problem.
Here is part of the code:
Sub cmdGo_OnClick
If (Len(Document.frmOpening.txtGuestNum.Value) = 0) Then
MsgBox "Please enter at least 1 guest."
Exit Sub
End Sub
Now, the problem is, I want the html page to STOP if the user didn't input any guests. How do I do it? This setting doesn't make the thing stop, it displays the MsgBox, then goes to the script.asp.
Please help me make it stop. Thanks. I'm a newbie.
Martin
-
Oct 3rd, 2000, 12:17 PM
#2
I am not too sure but you could use
window.close()
-
Oct 3rd, 2000, 03:07 PM
#3
Thread Starter
Member
Nope
No, that's not what I want.
window.close() will close the window.
What I want is after the msgbox appears, the user can enter the right value into the box, then proceed. But I don't want to proceed when it's not the right value.
Anyone??
-
Oct 3rd, 2000, 03:11 PM
#4
Thread Starter
Member
Never mind
Never mind, I got it. I just had to set the command type to be button instead of submit. then I put submit as one of the condition results. Thanks!
-
Oct 3rd, 2000, 04:01 PM
#5
Frenzied Member
Or:
Code:
Function frmOpening_onsubmit()
If (Len(Document.frmOpening.txtGuestNum.Value) = 0) Then
window.alert "Please enter at least 1 guest."
'This will prevent the form from submitting
frmOpening_onsubmit=False
End If
End Function
with the button remaining a submit button.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Oct 3rd, 2000, 04:10 PM
#6
Addicted Member
What you need to do is place an onsubmit in your form tag with return javascript.
Code:
<FORM method=post action=asppage.asp onsubmit="return (javascript function)">
-rest of form-
</FORM>
have the javascript function return a false(i think, I always mix up which does which) and it will stop the submission.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|