close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to check two unique value in the same record of the database?

Thread began 9/10/2018 11:45 am by tony | Last modified 9/11/2018 12:32 pm by Ray Borduin | 19 views | 2 replies |

tony

How to check two unique value in the same record of the database?

Hello all,
I have a form that has two fields that I want to validate. This couple of fields must be unique.
So, how can I validate them?
Have I to set them individually in the WA Server validation SB?
Then I set a conditional region to show only when the two fields do not validate?
I'm trying to do so, but the WA fails even one of the two fields differs.
How can check two fields to be unique during a single insert operation?
The validation should fail only when the two fields appear to be already inserted in the db in another record.
TIA
tony

Sign in to reply to this post

Ray BorduinWebAssist

There is no validation that will work like that out of the box. I think a good solution might be to add a recordset to the page and filter it by the two values and then you can validate that the number of records returned is zero.

Sign in to reply to this post

tony

Thanks for the reply, Ray,
I created the recordset, (rs_duplicated_fields) so that it will filter the DB table by two fields.
Then I created a WA server validation using the NUMBER rule. I set the validate field with $totalRows_rs_duplicated_fields and set the rule to minimum -1 and maximum to 0.
I moved the validation code under all my recordsets code and it seems to work now.
TIA
tony

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...