I'm trying to get the javascript working on my form to hide or show an input depending on the selection of a drop down.. HTML Code: <label> What Are You Looking To Finance :<select name="item" required=""> <option value="snowmobile">Snowmobile</option> <option value="automobile">Car/Truck/Suv</option> <option value="boat">Boat/Marine</option> <option value="atv">ATV, Side by Side, Off-Road</option> <option value="trailer">Recreationa/Trailer/RV</option> <option value="computer">Electronic/TV/Computer</option> <option value="other">Other</option> </select> </label> <div id="itemother"> <label> Please Describe Item : <input type="text" name="itemother" placeholder="Enter Description and Value" /> </label> </div> I'm trying to target the selection name item and hide or show the itemother if selection = the 7th or (other)
Javascript Help
8
I'm trying to get the javascript working on my form to hide or show an input depending on the selection of a drop down..
I'm trying to target the selection name item and hide or show the itemother if selection = the 7th or (other)
is what I was trying to use but it's not working - also have a css setup
HTML Code:
<label> What Are You Looking To Finance :<select name="item" required=""> <option value="snowmobile">Snowmobile</option> <option value="automobile">Car/Truck/Suv</option> <option value="boat">Boat/Marine</option> <option value="atv">ATV, Side by Side, Off-Road</option> <option value="trailer">Recreationa/Trailer/RV</option> <option value="computer">Electronic/TV/Computer</option> <option value="other">Other</option> </select> </label> <div id="itemother"> <label> Please Describe Item : <input type="text" name="itemother" placeholder="Enter Description and Value" /> </label> </div>
Code:
$('select[name=item]').change(function(){
if ($('select[name=item]').val() == '7'){
$('#itemother').show();
}else{
$('#itemother').hide();
}
}); HTML Code:
#itemother {
display: none;
} - kilgore
- solidsoul
- [1] reply
- kilgore
- David Beroff
- Wiliam Haminton
- [1] reply
- David Beroff
- [1] reply
Next Topics on Trending Feed
-
8