logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Spry
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 05-20-2011, 10:17 AM   #1
mrichards
 
Join Date: May 2011
Posts: 2
Question 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
mrichards@press.co.uk
mrichards is offline   Reply With Quote
Old 05-20-2011, 02:00 PM   #2
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

How about having one field for telephone. Make it required.
And then radio buttons/checkboxes to determine if it's a landline or cell.
domedia is offline   Reply With Quote
Old 05-20-2011, 02:19 PM   #3
mrichards
 
Join Date: May 2011
Posts: 2
Thumbs up Answered my question

Quote:
Originally Posted by domedia View Post
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
mrichards is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:51 PM.


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