Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Calling form.submit()


Message #1 by "Neal Lebar" <nlebar@i...> on Mon, 16 Apr 2001 16:26:00
Hi Neal,

The following is a very simple sample of submit within code:

<SCRIPT LANGUAGE="JavaScript">
<!--
function ProcessSubmit(){
//Enter Code here if necessary before or after sumbit
frmPostSurvey.submit();
return true;}
//-->
</SCRIPT>

Javascript is case and everything sensitive.  Do one thing wrong and it
ignores you.

Luck,
Christopher Koniges
Database/WEB Systems Programmer
Tel:  (xxx) xxx-xxxx
www.jazzysystems.com

-----Original Message-----
From: Neal Lebar [mailto:nlebar@i...]
Sent: Monday, April 16, 2001 4:26 PM
To: javascript
Subject: [javascript] Calling form.submit()


How do I call form.submit() from within a function?

I have a few drop down selection boxes... when the user makes the
selection in the last box, it uses the OnChange event to call a validation
function.  This function makes sure that the categories selected are all
different.  If not, it pops up an alert.

If all of the categories are all different, then I want to automatically
accept the form and submit it.

I'd like to do it right within the function ... but I get an error when I
try to call form.submit() within the function.  Perhaps I'm using the
wrong syntax to call this within a JavaScript function.

Another method would be to test the return code.... but I'm not sure how
to do this either.

The simplest would be to call form.submit() right within the function.

Thanks,

Neal


  Return to Index