Re: Page Submits twice
- From: "Steve Belanger" <desktop@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Feb 2006 14:18:33 GMT
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@xxxxxxxxx> wrote in message
news:1140775388.749370.260940@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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?
.
- Follow-Ups:
- Re: Page Submits twice
- From: Alan J. Flavell
- Re: Page Submits twice
- From: Hywel Jenkins
- Re: Page Submits twice
- References:
- Page Submits twice
- From: Umesh
- Page Submits twice
- Prev by Date: Re: How to check the traffic going to a website??
- Next by Date: Re: Changing CSS style in use for <TD> using Javascript - How?
- Previous by thread: Page Submits twice
- Next by thread: Re: Page Submits twice
- Index(es):
Relevant Pages
|