Try this:-
Conditional Submission
Notes:-
------
1. It is considered bad "form" (pun intended!) to submit forms without user action.
2. The onchange event is used for input types:- text, password as well as select and textarea elements.
3. The onclick event is used for input types radio and checkbox.
4. Cross browser scripting would require you to check the type. If the supported browsers implement DOM properly, you can check the element.tagName instead of the element.type.
Select elements have two values: select-one and select-multiple.
5. To submit a form via code, use the document.formName.submit() method.
6. It is good to have some validation, trimming leading and trailingspaces client-side. Saves work on the server.
7. Regular Expression is supported in Javascript 1.2 and above. You would have to write your own function
to trim values for older browsers using the substring and charAt methods.
Regards,
Brandon Driesen
Senior Analyst Programmer