Javascript - Simple form script to hide/show fields
- by danit
Im looking for a simple script in javascript that i can extend, at a basic level Im looking to show 1 field based on which option from a <select> the user chooses.
<select id="options">
<option value="spoon">Spoon</option>
<option value="form">Fork</option>
</select>
if select=spoon {
<input>enter your favorite soup</input>
} else {
<input>Your gonna need a knife</input>
}
Simple JS is the key!