mercredi 27 janvier 2016

how to apply if statement for form's

in real, i want to make this: i have 2 select field with some options in my form, and i want: if in first i select an option (for example with id="2"), second select filed changes auto pay attention to first field selected option.

<form>
<select>
   <option id="1"></option>
   <option id="2"></option>
   <option id="3"></option>
</select>
   #in here if select option with 1 id show select field with 1th id:
<select id="1th">
    #options here...
</select>

   #if select option with 2 id show select field with 2th id:
<select id="2th">
    #options here...
</select>

   #if select option with 3 id show select field with 3th id:
<select id="3th">
    #options here...
</select>
</form>

(change form other fields by changing form select field).

if you can make this with jquery. it will better even. thanks.

Aucun commentaire:

Enregistrer un commentaire