NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan de Klerk on September 15, 2026, 03:05:06 AM

Title: How to Hide and UnHide a Radio Option
Post by: Johan de Klerk on September 15, 2026, 03:05:06 AM
Hi,

I have a local variable: Loc:VehicleType
In this variable I have 6 options:
Option1 = Option 1
Option2 = Option 2
Option3 = Option 3
Option4 = Option 4
Option5 = Option 5
Option6 = Option 6

I am resetting this variable based on another selection made on the form.
There is a READ-ONLY IF CONDITION prompt on the template in the Option1 -> 6.
The READ-ONLY works and makes the Radion Option1 -> 6 Read-Only.
However I want to Hide Option1 -> 6 depending on the selection made on the other variable.

Is this possible and how would I do this.

Any help and suggestions would be appreciated.

Regards

Johan de Klerk
Title: Re: How to Hide and UnHide a Radio Option
Post by: Jane on September 15, 2026, 07:23:44 AM
What I would try:

For each of the options, in the CSS for that option use an expression like (this is pseudo-code)

Code: [Select]
CHOOSE(p_web.GSV('hide option variable'),' nt-hide','')
Title: Re: How to Hide and UnHide a Radio Option
Post by: rjolda on September 15, 2026, 09:16:41 AM
Hi,
I have a radio on a MemForm.  I have 7 options: 
Text: p_web.GSV('autoInfo1')  through ....  p_web.GSV('autoInfo7')
For each one I set the Include Conditon:  p_web.GSV('autoInfo1')<> ''   through .... p_web.GSV('autoInfo7')<> ''
So, I read my data and fill in each p.web.SSV('autoInfo1', mydata)   for each one that I need.
It is not a matter of hiding or unhiding - it is a matter of does the data exist - if yes, then the variable has a value.  If not, the variable has no value and thus is not included.
HTH,
Ron
Title: Re: How to Hide and UnHide a Radio Option
Post by: Johan de Klerk on September 15, 2026, 09:29:28 PM
Hi Jane/Ron,

Thanks for your suggestions.

I have a lot of conditions to check and then Hide or not Hide some of the Radio Options.
I eventually created a Routine with this code:
p_web.script('$(''label[for="Loc__VehicleType_1"]'').hide();')
or
p_web.script('$(''label[for="Loc__VehicleType_1"]'').show();')

From my test so far it seems to work 100%.

Regards

Johan de Klerk