|
-
Mar 9th, 2004, 12:08 PM
#1
Thread Starter
Fanatic Member
Add a msgbox if condition is true
When the user clicks the submit button, I run a function that validates the fields. The page will not submit unless the conditions are met. I want to know how to add a msg box if all the conditions are met....
<form id=Frm name=Frm method="POST" action="Page2.asp" onsubmit="Valid()">
<script language="Javascript">
function Valid()
{
if (Frm.txtName.value == "")
{
alert("Enter Name!");
Frm.txtName.focus();
event.returnValue = false
}
}
-
Mar 9th, 2004, 02:57 PM
#2
Frenzied Member
What do you mean by a message box, at first I thought you meant an alert(), but I see you know how to use them.
Have I helped you? Please Rate my posts. 
-
Mar 10th, 2004, 08:09 AM
#3
Frenzied Member
just FYI, I would only alert the user if something is wrong. If everything is ok, the page should just submit to a thank you page or something similar. (This would be more easily implemented in PHP, mind you.)
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
|