I want to hide and show the table row based on a condition. The id of my atable row is showhide2.
This is my part of code to use show/hide the row
<%if(group.equals("Y")){%>
<input<% try{if(dTO.getStat() == 0){%> style="display:none;" <%}}catch(Exception ex){} %> type="button" value="View" id="btnview" name="btnview" onclick="statusChange('view', 'add_userFrm');hide_menu('showhide2');loadDataForGivenDiv('add_userFrm');" class="button" style="width:100px"/>
<%}else{ %><input<% try{if(dTO.getStat() == 0){%> style="display:none;" <%}}catch(Exception ex){} %> type="button" value="View" id="btnview" name="btnview" onclick="statusChange('view', 'add_userFrm');show_menu('showhide2');loadDataForGivenDiv('add_userFrm');" class="button" style="width:100px"/>
<%}%>
But the button "View" not shows in my application.I cant solve this.
This is the function used to hide the row
function hide_menu(id){
document.getElementById(id).style.display = "none";
document.getElementById(id).style.width = "0";
}
I guess problem is in my code which has the button "View"