NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: olu on May 10, 2011, 09:27:48 PM

Title: make tick box require
Post by: olu 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
Title: Re: make tick box require
Post by: Rene Simons 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
Title: Re: make tick box require
Post by: olu on May 10, 2011, 10:57:11 PM
thanks rene that worked very well
Title: Re: make tick box require
Post by: Robert Iliuta 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
Title: Re: make tick box require
Post by: Rene Simons on May 14, 2011, 02:00:06 PM
Nice!
René
Title: Re: make tick box require
Post by: charl99 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