NetTalk Central

Author Topic: Form field conditional on another  (Read 3111 times)

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Form field conditional on another
« on: June 08, 2012, 12:19:20 AM »
I have a web form with a checkbox field (CAL:Active).

I have another ield (CAL:Status) which is a droplist.

IF CAL:Active is True
  I need to set the value of CAL:Status
  Unhide the dropbox
ELSE
  I need to set another value of CAL:Status
  Hide the dropbox 

Can someone help me re what code to embed where so that ticking and unticking the checkbox field has an immediate effect re setting and hiding/unhiding the droplist?

Many thanks.

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
Re: Form field conditional on another
« Reply #1 on: June 08, 2012, 01:20:02 AM »
you need to do 3 things

On the CAL:Active field
go to the client side tab
tick 'send new value to server'
on the 'server code' button enter the code to set the CAL:Status

On the same tab fill in the reset for CAL:Status

On the Cal:Status field
set the hide condition to :
p_web.gsv('CAL:Active') = 0

remember to always work with the session variables.


Now i have a question:.
I can reply to topics, but cant seem to find the button to post my own topics on nettalkcentral ,
am i getting to old ?

ianburgess

  • Full Member
  • ***
  • Posts: 119
    • View Profile
    • Email
Re: Form field conditional on another
« Reply #2 on: June 08, 2012, 02:40:52 AM »
Thanks for the advice - that worked!

I also had trouble getting to the right place in Nettalk Central, but have bookmarked a URL that takes me to the top of the "Ask for Help" section as follows: http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&board=2.0

Regards

Ian

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11239
    • View Profile
Re: Form field conditional on another
« Reply #3 on: June 11, 2012, 11:20:56 PM »
Hi Mike,

yeah - one of the reasons I'm not fond of this forum software.

a) first select a forum then;
b) click on the "Net Topic" tab.
(see attached pic).

cheers
Bruce



[attachment deleted by admin]