NetTalk Central

Author Topic: make tick box require  (Read 4596 times)

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
make tick box require
« on: May 10, 2011, 09:27:48 PM »
please how do i make it that a tick box field must be tick to save record just like the required fields works

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: make tick box require
« Reply #1 on: May 10, 2011, 10:42:32 PM »
Hi,

You can validate the corresponding field in the validate embed and test for the required value.
If the value is not up to your wishes, Put your error message in Loc:alert and put the name of teh field in loc:invalid and cycle.

example : In de validate embed type the following:

if tickbox <> 1
   loc:alert = 'Field is invalid. Box must be ticked.
   loc:invalid = 'tickbox'
end

I don't know if you must cycle here.
Just try.

Rene
Rene Simons
NT14.14

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Re: make tick box require
« Reply #2 on: May 10, 2011, 10:57:11 PM »
thanks rene that worked very well

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: make tick box require
« Reply #3 on: May 10, 2011, 11:00:07 PM »
Hallo,

You can put EXIT to stop executing next code. (if you have more code bellow this one)

if tickbox <> 1
   loc:alert = 'Field is invalid. Box must be ticked.
   loc:invalid = 'tickbox'
 EXIT
end

Robert

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: make tick box require
« Reply #4 on: May 14, 2011, 02:00:06 PM »
Nice!
René
Rene Simons
NT14.14

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: make tick box require
« Reply #5 on: May 15, 2011, 11:26:04 PM »
Robert,

I think you will better off if you say:

if p_web.gsv('TickBox') <> 1

ie, test for the Session Value.  My 2 cents.

Cheers
Charl