This topic is locked

Hiding a DIV by it's ID

11/9/2016 2:34:27 PM
ASPRunner.NET General questions
S
swiersman author

Hi new to ASP.NET Runner.
I am trying to hide a div by it's ID when a field is empty in the view page.

I have seen solutions as to hide a field on the View page/Before display event , but nothing for a DIV.
Logic I am trying to achieve:
IF Field A is ""
THEN DIV A is hidden.
Any help would be greatly appreciated.

T
Tim 11/11/2016

I'm not sure how to hid a DIV, but I have hidden a "section" on the fly. On the "totals" page of ASPR you can add a tab or section to your view page and put the field(s) you want to hide in there. Then in the JavascriptOnLoad onload event this is what I use:
var idrr = Runner.getControl(pageid, 'MYFIELD');
if (idrr.getValue() != 1) {

var section = "MY_SECTIONNAME" + pageid;; $("#section"+section).parent().hide();

}
you can figure out "MY_SECTION_NAME" by looking at the HTML.
Hope this helps.

Good luck.

Tim