Re: Validation (162 Views)
Reply
Regular Advisor
winnielee
Posts: 139
Registered: ‎09-29-2012
Message 1 of 6 (248 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

Honored Contributor
Piku
Posts: 4,046
Registered: ‎06-17-2010
Message 2 of 6 (212 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,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign Kudo, if found post useful and mark it accepted if solves the issue.
http://h30499.www3.hp.com/t5/Tips-and-Tricks/Kudos-what-where-how-and-why/m-p/5677925#U5677925
Honored Contributor
Vadim Gorda
Posts: 5,819
Registered: ‎11-10-2008
Message 3 of 6 (206 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.

Regular Advisor
winnielee
Posts: 139
Registered: ‎09-29-2012
Message 4 of 6 (184 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

Frequent Advisor
hardit
Posts: 34
Registered: ‎05-14-2013
Message 5 of 6 (176 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
Honored Contributor
Vadim Gorda
Posts: 5,819
Registered: ‎11-10-2008
Message 6 of 6 (162 Views)

Re: Validation

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

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.