Say i have a table row with the two text boxes and i want to manipulate them based on the screens and some array values
<tr id ="myrow" style="display:none">
<td>
test1<input type="text" name="some" value ="some">
test2<input type="text" name="test2" value ="test2">
</td>
</tr>
i am using the same form for all the screens .same form is being rendered for all screens so iam having a hidden value iam manipulating the things based on hidden
var somearr = ['AAA','BBB','CCC','DDD'];
//ready function
if ($("#hi_showelements").attr('value')=="screen1"){
$("#firsttd").removeAttr('style'); //we have the td but not shown above
}
else if($("#hi_showelements").attr('value')=="screen2"){
$("#myrow").hide();
else if($("#hi_showelements").attr('value')=="screen3"){
$("#myrow").hide();
}
else if ($("#hi_showelements").attr('value')=="screen4"){
$("#myrow").hide();
}
if($.inArray(somecode,somearr)=='-1'){
$("#myrow").hide();
}
else{
$("#myrow").show();
}
the above row "myrow" is hidden correctly in the scrren1,screen2,screen3,screen4, .
But my problem is i cannnot hide the row in the same screens
say if "somecode" value is "AAA" which is present in the "somearr "
array and which is not equal to "-1" and the "#myrow" is being shown .
How can i hide this row if the "somecode" is present in the "somearr"