Validate at least one phone number & the numbers themselves?
Hi have a form with three fields for home phone, work phone & mobile phone.
I've got jquery to validate that the numbers entered are the right format, i.e. using the following with custom methods for the phoneUK etc.
- x_HomeTel: {required: true, phoneUK: true},
- x_WorkTel: {required: true, workUK: true },
- x_MobileTel: {required: true, mobileUK: true },
The thing is I only need one of these numbers. I have been trying *all day* to try and get this to work but no joy. I know I need to group them somehow but can't figure it out.
I want it so I get a single message if all fields are left empty and then if a field does have an entry then it's validated to ensure its a number. Any help much appreciated!