Reply to Re: Page Submits twice

Your name:

Reply:


Posted by Steve Belanger on 02/24/06 16:18

Even though your question has to do with Javascript and this is an HTML
group, here's something that might help you.

Get rid of the onsubmit parameter on the form.

Use it on the button itself, like this:

<input type="button" onclick="validateform()" name="save" id="save"
value="save">

Now inside the function itself, if the form is set to be submitted, do this
just before the return true line:

document.abc.submit();


Hope this helps.
Steve.


"Umesh" <mec.umesh@gmail.com> wrote in message
news:1140775388.749370.260940@v46g2000cwv.googlegroups.com...
> Hi
>
> Here is the sample code for my form, but problem is that it submits
> twice in some cases when i click submit button.
>
>
> <script>
> function validateform (){
> //do a lot validation here, if validation failes, return false;
>
>
> //finaly this line
> return true;
>
>
> }
>
>
> </script>
>
> <form name="abc" action="any other apge" onsubmit = "return
> validateform();">
>
>
> <input type="submit" name="save" id="save" value="save">
> </form>
>
>
> Can any one help me?
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация