NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: springguy on February 23, 2014, 06:55:22 PM

Title: Conditional Hide Form Field
Post by: springguy on February 23, 2014, 06:55:22 PM
NT 7.31  C9.0
I have a NetForm with a field (ShipStyle) that is a dropdown.  The dropdown file that contains the ShipStyle field also contains a field called "mode."  Based on the ShipStyle that is chosen, I need to hide/unhide a field ("ShipDate") on the form based on the value of the "mode" field.

I have the following hide/unhide entries in the template settings for the ShipDate field"

Hide:  p_web.GSV('mode') = 'Y'
Unhide: p_web.GSV('mode') = 'N'

Two issues:

1. On inserting a new record, and the ShipSyle is selected from the dropdown, how do I get the hide/unhide template conditions for the ShipDate field to be processed?

2. On Changing an existing record where the ShipStyle field is already filled in, how do I get the ShipDate hide/unhide template conditions (or embed code) to be executed on the form start up?

Mike Springer
Title: Re: Conditional Hide Form Field
Post by: Bruce on February 24, 2014, 02:23:00 AM
>> 1. On inserting a new record, and the ShipSyle is selected from the dropdown, how do I get the hide/unhide template conditions for the ShipDate field to be processed?

In the Value::FieldName routine for the ShipDate
Open the file
read the record (using the session value of ShipStyle to load the record)
save the record to the session queue (or just shipstyle:mode if that's all you need)
close the file

Then of course add the ShipDate field to the Reset list of the Dropdown field.

Cheers
Bruce