NetTalk Central

Author Topic: How to code the clearing of a checkbox on a form  (Read 4124 times)

Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
How to code the clearing of a checkbox on a form
« on: January 28, 2018, 02:19:17 PM »
Hi there,
I have a form on which I have a check box. it is a local variable.
The setting of the checkbox determines what code routine is run.
I have a refresh button which has p_web.redirect(formname) included.
This works in that it hides a second  button but it will not reset the checkbox to 0

I need the checkbox to either be coded to return to 0 and display, or have the p_web.redirect  reset to zero and display,...
or ?
I tried setting a session value to it and while I can get the STOP statement to return 0 the  form is not refreshed  showing the untcked checkbox.

manually unchecking the box is not an option
How can i achieve this refresh  please....

Thanks,
Regards,
Richard
NT 8.71

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: How to code the clearing of a checkbox on a form
« Reply #1 on: January 28, 2018, 05:26:36 PM »
Hi Richard,

You can change a value (local or otherwise) in code and update a form from an embed point, in this way:

Assuming your local variable is called "LocalVariable".

p_web.SSV('LocalVariable',0)
DO Refresh::LocalVariable

If you watch in your browser, you'll see an ajax packet changing the html to reset to checkbox to zero.

Your use of the web.redirect function seems potentially obtuse, but I cannot see your code to be clear, so it may well be appropriate.

With NetTalk your really shouldn't need to use web.redirect to call yourself to force a refresh (if in fact that is what you are doing) - unless data is changing behind the scenes and you want to update for that reason.


Regards
Bill



Richard I

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: How to code the clearing of a checkbox on a form
« Reply #2 on: January 28, 2018, 05:47:27 PM »
many Thanks Bill....