Pages

Search This Blog

Monday, 6 January 2014

jQuery/Javascript to hide and make the controls visible

For some users the controls should not be visible. For instance only the administrator user should have approve access and for other users the approve option should not be visible. In this case the following sample will help:
 <input id="approve" type="button" class="btn btn-primary" runat="server" style="visibility:hidden; background-color:#688A08" value="Approve"/>

The above html code is for a button and it is not visible while page load. To make it visible at run time using Javascript the following will help:

document.getElementById("approve").style.visibility = 'visible';

No comments:

Post a Comment