NetTalk Central

Author Topic: NetTalk 6.51 - WebServer Form - embeds to enable or disable field  (Read 5271 times)

Jeff Martens

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Where and what do I use in embeds to enable and disable and to hide and unhide fields as a user does data entry, depending on what the user enters in selected fields?

And .. if I have missed seeing these techniques in examples or elsewhere, I would appreciate being directed so I can see the syntax and see it in use.

Thanks.
---

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #1 on: December 12, 2012, 02:09:08 AM »
Hi Jeff,

As you can see in the template, you can give any field a condition when it has to be displayed and when not.

For all fields which are playing a role in any of these conditions, go to the client tab and tick the box to send the new value to the server.

Click the client side code button and, in the embed, type:  p_web.ssv('myXXX;yesNo', XXX:yesNo) - to store the value of field XXX:yesNo into sessionvar myXXX:yesNo.

Save and close the embed.

Add the (to be) conditioned field to the reset-list in the template. This is to reset the field after this client side code has completed.

Set the condition for the field, using the session vars. In this case use p_web.gsv('myVar') to retrieve the actual value of the var.
E.g.:     'myXXX:yesNo = ' & p_web.gsv('myXXX:yesNo')       ! myXXX;yesNo is numeric here.

Alfanumeric fields need some extra quotes like:
'XXX:yesNo = <39>' & p_web.gsv('myXXX:yesNo') & '<39>'   ! <39> is a single quote

When typing in a condition field, use F10 to create a bigger field on the screen for a better view.

Cheers,
Rene
Rene Simons
NT14.14

Jeff Martens

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #2 on: December 12, 2012, 01:17:55 PM »
Rene -

Thanks for your response.
I am not sure whether your suggestions will help me.

I want to create a dynamic form.
Suppose there are fields like these on the form with appropriate prompts:

FYL:ID
FYL:NAME
FYL:SEX (M/F)

      ! sex can be evaluated immediately
      ! depending on sex, one or the other of these will show or be hidden, or be enabled or disabled
      ! I want to know how to apply both ideas

  if fyl:sex='M'
   FYL:SHIRTSIZE
  elsif fyl:sex='F'
   FYL:DRESSSIZE
  .

Thanks.
---




« Last Edit: December 12, 2012, 01:20:59 PM by Jeff Martens »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #3 on: December 12, 2012, 09:51:58 PM »
Hi Jeff,

Rene's suggestions will exactly help you. But I suppose they need some context.
Check out the "Calculator" example, especially the "Area" tab. This hides, and unhides fields based on the drop-down.

cheers
Bruce

Jeff Martens

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #4 on: December 13, 2012, 12:18:35 AM »
Thank you Rene and Bruce for that direction.
I will review the example and go from there.
----

ramiro

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #5 on: February 15, 2013, 10:55:52 AM »
NetTalk 6.08
I have two string fields contiguous on a form,
How do you make the field was hidden,  to be unhide by the first,  the field is selected? and not the next field


thank you in advance

regards

Ramiro M B

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #6 on: February 16, 2013, 08:28:04 PM »
NetTalk 6.08
I have two string fields contiguous on a form,
How do you make the field was hidden,  to be unhide by the first,  the field is selected? and not the next field


thank you in advance

regards

Ramiro M B

In second field set a condition in the "Include" or "Hide" property. 

For example, in the "Hide" property:  p_web.GSV('FirstField') = 1 

Now, in the first field, set it to "Reset" the second field.   This will cause the second field to "reset" every time the value changes in the first field ( and therefore re-evaluate the HIDE or INCLUDE condition).   

So, in my example, if you were to enter the number 1 in the first field and pressed the TAB key, the second field would be hidden.  Enter something other than the number 1, the second field would not be hidden. 

Anyway, I hope I least got you pointed in the right direction.  It pretty simple once you get accustomed to it.

Good luck,

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11

ramiro

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #7 on: February 18, 2013, 11:45:07 AM »
Thanks Don,
but my problem is that when the first field activates the second, in the browser the selected field is not the second, but the third field in the form.  ie skips the second and the user manually select the second field.
Can automatically selected field is the second?

thank you very much.
Ramiro

DonRidley

  • Don Ridley
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 729
  • donaldridley2011@gmail.com
    • View Profile
    • Email
Re: NetTalk 6.51 - WebServer Form - embeds to enable or disable field
« Reply #8 on: February 18, 2013, 07:15:17 PM »
Ahhh..do you have the second field setup as a "display" field?  If so, try making it a read only entry field (string).

I do believe the tab order will "skip" "display" fields.

I think I understand your problem.

Don
"Eliminate the impossible, whatever remains, however unlikely, must be the truth."

NetTalk 12.55
Clarion 11