[thelist] Submitting a form with javascript

Tab Alleman Tab.Alleman at MetroGuide.com
Mon Nov 3 14:56:11 CST 2003


Well that's true that a button can be dynamically created too.. But
dammit, I know there've been times when I *had* to have a link that
submitted a form, but now I can't remember why.  Maybe it was just
aesthetics after all.  

Part of it might have been that I once didn't know that a form could
have multiple submit buttons, all with the same name, and whichever was
clicked would send its name/value pair in the form object to the
processing script.  So in order to have the script handle the form
differently depending on which button was clicked, I used a javascript
function to populate a hidden input and then submit the form.  It was
the only way I knew how to tell which button was clicked, but now I know
there's a better way.  


More information about the thelist mailing list