[Javascript] multiple onSubmit events not working

Amol Katdare amol.forums at gmail.com
Thu Sep 1 09:50:32 CDT 2005


<form name="form" action="dothis.php" method="post" onSubmit="return
check_upload_required(); openpopup(); submitonce(this);">
 To invoke all the 3 methods, just remove the keyword "return".
i.e.
<form name="form" action="dothis.php" method="post" 
onSubmit="check_upload_required(); openpopup(); submitonce(this);">


 On 9/1/05, Ed Curtis <ed at homes2see.com> wrote: 
> 
> 
> I tried the mentioned process but the submit button on the form does not
> disable. Any suggestions?
> 
> On Thu, 1 Sep 2005, Nick Fitzsimons wrote:
> 
> > >
> > > I'm attempting to clear three functions with a single onSubmit form 
> event.
> > >
> > > <form name="form" action="dothis.php" method="post" onSubmit="return
> > > check_upload_required(); openpopup(); submitonce(this);">
> > >
> > > The check_upload_required function works as expected but the script 
> never
> > > executes the openpopup() or submitonce(this) functions. If I remove 
> the
> > > check_upload_required() from the onSubmit event the other functions 
> work
> > > as expected. Can anyone shed some light on why this is happening. I 
> really
> > > need for all three functions to work together.
> > >
> >
> >
> > When you use "return check_upload_required;" it does exactly that -
> > returns with the value that came back from the function, and therefore
> > stops processing any code after that point.
> >
> > Try defining a single function:
> >
> > function submitHandler(theForm) {
> > var result = check_upload_required;
> > if (result) {
> > openpopup();
> > submitonce(theForm);
> > }
> > return result;
> > }
> >
> > and change the handler to
> >
> > onsubmit="return submitHandler(this);"
> >
> > HTH,
> >
> > Nick.
> > --
> > Nick Fitzsimons
> > http://www.nickfitz.co.uk/
> >
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20050901/fc9911b4/attachment.htm>


More information about the Javascript mailing list