We have in html inputs like text, radio, select and textareas.
In my situation i had radio inputs and i needed to create trigger which should effect other inputs ( disable them ).
My inputs:
JQuery:
Demo: http://igloro.info/demos/disableinput.php
In my situation i had radio inputs and i needed to create trigger which should effect other inputs ( disable them ).
My inputs:
Other section which i want to disable:<input name="order_type" type="radio" value="2" /><br /> <input name="order_type" type="radio" value="3" /><br /> <input name="order_type" type="radio" value="4" />
<input class="viewspereach" name="text" type="text" value="" />
JQuery:
$("input[name=order_type]").change(check_ordertype); function check_ordertype() { var order_type = $("input[name=order_type]:checked").attr("value"); if(order_type == 4) { $(".viewspereach").prop('disabled', true); } else { $(".viewspereach").prop('disabled', false); } }