Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   Spry (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=189)
-   -   How to validate 2 inputs, one must be filled but the opposing field can be blank? (http://www.dreamweaverclub.com/forum//showthread.php?t=40333)

mrichards 05-20-2011 09:17 AM

How to validate 2 inputs, one must be filled but the opposing field can be blank?
 
Hello everyone,

I am new to spry and trying to update some code for a friend but I can not work out the validation conundrum I am currently experiencing.

I have two fields, both plain text inputs; I would like to be able to validate them both but the problem is that I only require one of them to be validated at any one time.

For example, Home Tel or Mobile Tel: The user can enter either, and are not required to enter both, but must enter at least one of the fields to complete the form.

It would be very much appreciated if any one could find an answer, if not you still have my thanks for trying.

Hopefully I can get past the problem without replacing the spry validation, as it is working so well. Although if forced to by my problem I will eventually admit defeat and use a form of JQuery validation.

Thanks

All the best

Matt Richards 8-)
mrichards@press.co.uk

domedia 05-20-2011 01:00 PM

How about having one field for telephone. Make it required.
And then radio buttons/checkboxes to determine if it's a landline or cell.

mrichards 05-20-2011 01:19 PM

Answered my question
 
Quote:

Originally Posted by domedia (Post 194519)
How about having one field for telephone. Make it required.
And then radio buttons/checkboxes to determine if it's a landline or cell.

I hadn't thought of it that way, I think that could work with what I have. It isn't exactly home telephone and mobile but the example will translate nicely

Thanks again!!

Matt Richards


All times are GMT. The time now is 07:26 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com