I have a form which requires a date of birth to be submitted. I have three drop down boxes, one for the day, one for the month and one for the year. The default values are set to 00, 00, 0000 for the day month and year. It is important that people do select an acceptable date of birth. However if the fields are set to 'required', then by default they are already completed, as they contain default values. Is there a way in which if a client tried to submit the form then it would detect that either the day, month or year still contained the default value, and would then display an appropriate error message asking the client to enter a valid date of birth.
Thanks for any help.
Mark
Thanks for any help.
Mark
Hi Mark,
Try to make the first option of the 3 fields like this then use the required validation:
Cheers
Max
Try to make the first option of the 3 fields like this then use the required validation:
<option value="">day</option>
Cheers
Max
Thanks for the help, your suggestion worked perfectly.
My next 'problem' is how do I get a field to be mandatory field, only if another field has been completed.
My client may have a second child, so they only have to complete the next date of birth fields if they enter a name in the 'Second Childs Name' field.
Thanks
Mark
My next 'problem' is how do I get a field to be mandatory field, only if another field has been completed.
My client may have a second child, so they only have to complete the next date of birth fields if they enter a name in the 'Second Childs Name' field.
Thanks
Mark
Hi Mark,
this is alittle advanced for the validation included but you can create it your self with some JS code!
Cheers
Max
this is alittle advanced for the validation included but you can create it your self with some JS code!
Cheers
Max
Hi Mark, check Bob's code here, its almost what you need:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=5&t=12259
Max
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=5&t=12259
Max
This topic is locked and no more replies can be posted.