Hello,
I need to change the “name” part of the <input> of a form accordingly to an option selected from a dropdown.
Please refer to the code to understand what I mean.
The form is something like this, with a submit onchange
I’m not a programmer but I’m willing to learn as I need to make it work, but please explain things to me in a human understandable way:)
Thanks a lot.
mass
Thank you ralph.m.
I semplified the code, which is part of something bigger.
The form is part of a template (smarty) of a commercial cms I bought.
I do need to submit the form with 2 different names, accordingly to the option selected, if you want I can post the whole code but I don’t think it’s worth to know it.
I don’t want to use php as the original code uses already some JS and also because I’m not comfortable with it.
Thanks.
mass
Hello.
This CMS is structured to be “easily” customized; the form I want to modify in fact is part of a template (smarty).
So, no problem with code changing.
Anyways…
The “Original” code is something like this:
The parts in bold arethe ones I added.
At the bottom of it you will noticed 2 lines of code I commented out. They were 2 submit button I’m trying to get rid of, and that’s the reason why I want to change the “name part” of the <input> line to change in accordance to the option selected.
The code above works but it only submits, I wanto to add 1 more option (<option value=“RESET”>RESET</option>) and cause the form to submit as if it was BUTTON2 if “RESET” is selected and like BUTTON1 if the other option are selected.