Re: Validation (99 Views)
Reply
Regular Advisor
winnielee
Posts: 135
Registered: ‎09-29-2012
Message 1 of 6 (185 Views)

Validation

Hi All,

 

I would like to have validation for scenario below:

For Checkbox:

1) vendor

2)manufacturer

User must tick either 1 in order to save the vendor record, user cannot tick both or ignore it

Anyone can gv me the valid condition?

Thanks in advance

Please use plain text.
Honored Contributor
Piku
Posts: 3,687
Registered: ‎06-17-2010
Message 2 of 6 (149 Views)

Re: Validation

Hi,

Try,

update/add : (not null (vendor in $file)) or (not null (manufacturer in $file))
validation : vendor in $file=1 and manufacturer in $file=1

Also can try for radio button by grouping them. See dep.g for logic used.

hth,
Please use plain text.
Honored Contributor
Vadim Gorda
Posts: 5,523
Registered: ‎11-10-2008
Message 3 of 6 (143 Views)

Re: Validation

[ Edited ]

I would say that it must be three separate lines as you need to get rid of the both boxes checked at the same time as well.

 

update/add : null(vendor in $file)

validation : manufacturer in $file=true

 

update/add : null(manufacturer in $file)
validation : vendor in $file=true

 

update/add : true

validation : null(vendor in $file) or null(manufacturer in $file)

 

If first field is empty then second field must be checked and vice versa.

Please use plain text.
Regular Advisor
winnielee
Posts: 135
Registered: ‎09-29-2012
Message 4 of 6 (121 Views)

Re: Validation

Hi Piku/Vadim,

 

Thanks for both prompt response, I am using

not  (same(is.vendor in $file, is.manufacturer in $file))

seems it wont happen to tick both

Please use plain text.
Frequent Advisor
hardit
Posts: 34
Registered: ‎05-14-2013
Message 5 of 6 (113 Views)

Re: Validation

Hi,

 

You can use a radio button for this and make this as mandatory field and give these two radio buttons a value and while saving you can put a vlidation and check  the radio button should have a value .

 

Cheers,

Hardit Singh

Cheers,
Hardit Singh
Please use plain text.
Honored Contributor
Vadim Gorda
Posts: 5,523
Registered: ‎11-10-2008
Message 6 of 6 (99 Views)

Re: Validation

In fact radio button will really limit that on form bases.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation