onChange=”document .form. submit()” doesn’t work


3 Votes, Rating: 41 Star2 Stars3 Stars4 Stars5 Stars

Tags: , ,

Javascript : Document.form.submit() not working in Firefox/IE

Error: document.form.submit() is not a function.

This is so simple function in javascript to submit any form by onchange/onclick any select list. but some time it creates so many problem to fix, i have checked on google lot of guys has same problem, some time few forum has unreplied thread from last 5 years. dont you think is amazing.

Yes its, very minor problem to solve.

we use this type of javascript for onclick/onchange submit any form

<SCRIPT LANGUAGE=”javascript”>

<!–

document.forms(”form1″).submit()

//–>

</SCRIPT>

There no problem in your script if you use similar you might have problem on your form submit button, most of time we create submit button with name=”submit” or id=”submit” this creates this problem coz javascript take submit() as a button name and not behave like function.

Solution

easy and simple change your submit button name & id to anything else. not “submit” like “submitbutton” and its done

check and let us know

Share/Save/Bookmark

Leave a Reply


CSS (Design) - TOP.ORG