Groups | Blog | Home
all groups > inetserver asp db > march 2004 >

inetserver asp db : Pop-Up Form Validation and Automatic Window Closing


Chad S
3/30/2004 11:27:45 AM
Hello,

Got a question for you guys... thanks for taking a look at this.

Question:
I have a link which pops-up a form. I have a validation script which
checks the values in the form upon submission. I have all this working
great. My issue is I want to also automatically close the pop-up after
the validation is complete and all returns true. Then submit the
information to the database.

As you can see in the code below I call the validator which is included
in the page. I then have a timeout, but whenever the validator returns
false it still closes the form. How do I keep it from closing the form
until the validator returns true ?

Form Code:
<form name="aForm" method="Post"
action="submit_proceduralinformation.asp?PageState=AddImplant"
target="frmDeviceImplant1" onSubmit="return(aForm_Validator(this)),
setTimeout('window.close()',10)">

Validation Code:
<script language="JavaScript">
<!--
//---------- Validate Valve Sizing Fields
function aForm_Validator(theForm)
{
//----- Validate Size

if (theForm.ddSize.selectedIndex <= 0)
{
alert("Missing Value: Size.")
theForm.ddSize.focus();
return (false);
}
}

Thanks !

Chad



*** Sent via Developersdex http://www.developersdex.com ***
Bob Barrows [MVP]
3/30/2004 2:40:54 PM
[quoted text, click to view]

Sorry, but this question has nothing to do with asp.

While you may be lucky enough to find someone here who will take the time to
answer your question, you can eliminate the luck factor by posting to an
appropriate newsgroup.

I suggest you find a client-side jscript newsgroup and ask it there. Look
for a group with "dhtml" and "jscript" in its name, or go to the
..scripting.jscript group.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

AddThis Social Bookmark Button