NetTalk Central

Author Topic: Conditional Hide Form Field  (Read 2440 times)

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Conditional Hide Form Field
« 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Conditional Hide Form Field
« Reply #1 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