11:54am September 16, 2005
Submit Form onChange with JavaScript

I've been fighting with IE and FF for a couple days now, trying to get a JavaScript "onChange" to work. I wanted a table of employees to be automaticly updated when someone selected an option from a form drop down menu. I had no problem getting it to work in one or the other browser, but never in both browsers at the same time.

After searching around the net for a way to get this done, I finally found the correct way to get the job done in both IE and FF. By simply putting a 'onChange="Javascript:document.form1.submit()"' in the <select> tag, the form will automaticly submit the form(which reloads the page and the table on it) without the need for a submit button to be pressed.

Views  1622 Comments  3
Filed under: Javascript
Add Comment
Michael
Thanks for the article---I spent an hour looking around the 'net before I found your solution to my little problem. Good work!
billy
do you know to have that onchange option, but still be able to have a submit button on the form? currently it works only if i don't have a submit button on the form
Chris Charlton
Hi, I know this article is pretty old but it has just helped me out. It's amazing how difficult it is to find the basics out there on the net.
View Chris Thompson's profile on LinkedIn
Loading...