jquery - Javascript to set hidden form value on drop down change -


New to JavaScript, but I'm sure it's easy. Unfortunately, most Google results are not helpful.

Anyway, in the dropdown drop down selection, when I want to set the value of the hidden form element through javascript.

I can use JQuery, if it makes the value easier to get or set.

If you have HTML, for example:

  & Lt; Select ID = 'myselect' & gt; & Lt; Option value = '1' & gt; A & lt; / Options & gt; & Lt; Option value = '2' & gt; B & lt; / Options & gt; & Lt; Option value = '3' & gt; C & lt; / Options & gt; & Lt; Option value = '4' & gt; D & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = 'hidden' id = 'myhidden' value = '' & gt;  

All you have to do, and whatever you need there:

  

All things are considered, if you are doing a lot of jQuery programming, then always open.

It is very easy to give you a chance, it is very easy

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -