NetTalk Central

Author Topic: Validation On Completion Of A Form Field  (Read 3052 times)

bryce

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Validation On Completion Of A Form Field
« on: May 31, 2013, 01:18:25 AM »
The section on 'Dynamic Forms' in the NetTalk book talks about adding server side code to update the form.  I can manage to update the Value of a field but cannot get the Prompt or Comment to update with new values.  Can anyone tell me how to do this please?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Validation On Completion Of A Form Field
« Reply #1 on: May 31, 2013, 03:55:42 AM »
On the client side tab, when you add the field to the list, you specify which parts of the field get updated. The default is "value" but you can turn on "prompt" and "comment" there as well.

cheers
Bruce

bryce

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Validation On Completion Of A Form Field
« Reply #2 on: May 31, 2013, 07:27:03 AM »
Thanks Bruce.  I think I am misunderstanding something here.  I have ticked those items but should I be able to change what is displayed in them (ie. different text) when they are refreshed.  If so, what session variable (or otherwise) would I change?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Validation On Completion Of A Form Field
« Reply #3 on: June 01, 2013, 09:20:37 AM »
Prompts and comments are generated in the
prompt::fieldname and
comment::fieldname routines .

What I recommend is that you right-click on the procedure, choose "source" and embed whatever you like in those routines before the generated code.

This is one of the few times that you can use a local variable for the prompt and comment, and then in the top of those routines set the local variable to whatever you like.

Typically they are "fixed" values, they don't come from session values - but obviously it all depends on what you set the template prompt to.

cheers
Bruce

bryce

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • Email
Re: Validation On Completion Of A Form Field
« Reply #4 on: June 01, 2013, 10:54:56 PM »
OK, thank you.