Saturday, October 17, 2009

Hide Controls using browser scripts

How to hide controls using browser scripts.

If the requirement says that particular button control should be disabled while doing a query or any other event like save,delete etc

write the following script on pre invoke event where Method name = Query/Save/Delete

var controlVar = this.FindControl("Control  Name");
controlVar.SetProperty("Visible", "false");

Or if the requirement says  the control should be enabled at particular event.
Write the following script on pre invoke event for method = Execute Query

var controlVar = this.FindControl("ControlName");
controlVar.SetProperty("Visible", "true");



http://www.siebeldigest.com/

1 comments:

David Rodriguez said...

Is it possible to do the same but in a list applet?
I used this code in a form applet a worked fine, but in list one, I'm not able to.
Do you know any other wat to hide a list column?
Many thanks in advance!
David