I have selectbox like this
rows 1
<form action="" method="POST">
<select id="showhide">
<option value="0">-SELECT-</option>
<option value="1">Show</option>
<option value="2">Hide</option>
</select>
<input id="txtname" type="text" name="txtname" style="display:none;">
</form>
rows 2
<form action="" method="POST">
<select id="showhide">
<option value="0">-SELECT-</option>
<option value="1">Show</option>
<option value="2">Hide</option>
</select>
<input id="txtname" type="text" name="txtname" style="display:none;">
</form>
and javascript
$(document).ready(function(){
$("#showhide").change(function(){
var valx = $('#showhide').val();
if(valx == '1'){
$("#txtname").show();
}else if(valx == '2'){
$("#txtname").hide();
}
});
});
when i use selectbox in rows 1 show/hide the inputbox in rows 1 working, but when i use selectbox in rows 2 the show/hide not working like rows 1.
how to solved this.
thankyou