0
Hello,
I have this page in html and would like to know how I can do so so that when changing the item chosen in the dropdown menu, the html fields change.
<fieldset id="fsItem">
<legend>Item
<button id="bAnt"><</button>
<input type="text" class="input" id="idItem" value="0" disabled>
<button id="bNex">></button>
<button id="bAdd">+</button>
<button id="bRem">–</button>
</legend>
<label>Item</label>
<select>
<option value="person">Person</option>
<option value="vehicle">Vehicle</option>
<option value="animal">Animal</option>
</select>
<p><label>Name</label>
<input type="text" class="input" id="nameItem" value="" disabled>
<p><label>Age</label>
<input type="text" class="input" id="ageItem" value="" disabled>
<label id="lbAs">Associate</label>
<input type="checkbox" class="input" id="chkAs" value=""></p>
<p><label>Details</label>
<textarea class="input" id="detailsItem" rows=5 disabled></textarea></p>
The default page would be "Person". When selecting "Vehicle", for example, the "Name" and "Age" fields would be replaced by "Type" and "Color". The "Associate" would disappear.
Thanks in advance,
It is difficult to give a good answer because I am in the mobile APP and the text would be great! But I’ll give you just an idea. Think of it as if your "option" was an anchor link. That by selecting you would trigger a function! In case you can trigger a function that will read the value attribute. With this attribute you will generate a new function and apply its result to the label referring to the selected option!
– ivan veloso
thanks for the idea!
– Drako