close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Validate two fields at the same time?

Thread began 5/22/2019 3:09 am by SCar87011738 | Last modified 5/22/2019 9:53 am by Ray Borduin | 274 views | 2 replies |

SCar87011738

Validate three fields at the same time?

Hello all,
I have three fields (selects) in a form and I need to validate them in a particular way:
field1: mytype (values are 1 or 2);
field 2: myhour: (values are 00, 01, 02,..., 23);
field 3: mymin (values are: 00, 01, 02,...,59);

If I select 2 from field1 the validation would allow any value from field2 and field3.
But if I select 1 in field1, the values of field2 and field3 must be both '00' to pass validation.

Is there a way to do this?
Or, what is the best approach to solve this problem with WA tools?
TIA
tony

Sign in to reply to this post

SCar87011738

perhaps I found a solution:
I added a new rule to wa server validation sb:

Validation Type: Required...
Server variable: ((((isset($_POST["field2"]) && $_POST["field2"] != "00")) || ((isset($_POST["field3"]) && $_POST["field3"] != "00")) && ((isset($_POST["field1"]) && $_POST["field1"] == "1")))?"":$_POST["field1"])

It seems to work.
Is there a better way to do this?
TIA
tony

Sign in to reply to this post

Ray BorduinWebAssist

That seems like a perfect solution. Just like anything else there are multiple ways to accomplish this, but yours seems efficient and effective.

Sign in to reply to this post
Did this help? Tips are appreciated...

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...