Re: Page Submits twice



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?



.



Relevant Pages

  • Re: hover action and foreground image
    ... The first is that there too many errors showing under validation ... Got rid of the ones I knew how but there's a few left ... Do you know that css sheets are like ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Custom validation
    ... If I get rid of the ControlToValidate property then validation function is ... > For client-side validation, use the ClientValidationFunction property ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: VBA Inserted Data Validation Fails
    ... Get rid of the equal sign in your list. ... Also, if you run this more than once, you need to delete the validation, ... this functionality that fails. ... speicifying any other object requirements. ...
    (microsoft.public.excel.programming)
  • Re: Validation drop down box too large
    ... Extra wide dropdown lists appear occasionally, usually if cells on the worksheet have been merged (not necessarily the cell with the data ... To get rid of them, you may have to delete the row or column and recreate the data validation. ...
    (microsoft.public.excel.misc)
  • Page Submits twice
    ... twice in some cases when i click submit button. ... function validateform { ... //do a lot validation here, if validation failes, return false; ...
    (alt.html)