This topic is locked
[SOLVED]

 showing/hiding tabs on page

1/18/2018 4:13:53 PM
ASPRunner.NET General questions
A
admin author

Hi Experts,
I have a page with tabs - basic, cardata, totals, finance

One of the fields on the page is named betaling

If value["betaling"] = 1 the finance tab page must be disabled
Page layout is bootstrap_2col
I tryed this in the addpage JavaScript on load event
var ctrlbetaling = Runner.getControl(pageid,'betaling');

var tabs = pageObj.getTabs();

if (Number(ctrludbetaling.getValue()) == 1)

tabs.hide(3);
but it is not working!
What am i doing wrong?
Thanks in advance
Michael

A
admin author 1/19/2018

I am a Little further but still far away :-)
Inserting this in JavaScript on load on addpage:
var tabs = pageObj.getTabs();

tabs.hide(6);
hides the tab on load - Works :-)
following does not Work in the JavaScript on load
function func() {

If (Number(ctrlbetaling.getValue()) != 1)

{

tabs.activate(6);

}
}

}

ctrlbetaling.on('change', func); // i know that ctrlbetaling.getValue() have the value 1,2,3 or 4

A
admin author 1/19/2018

I have solved it with thanks to Pete K' solution.

Thank you Pete K
Pete's solution