Just curious...I have a form with a phone field and an email field. I'd like to make sure that the user completing the form adds at least one of the fields, but not necessarily both.
Is there a way to do this with Chronoforms? I suspect it might be along the lines of dynamic validation that would require some javascript and whatever else, but I'm thinking there could be a form action after submit that checks to see if one of the fields is completed.
Any thoughts?
Is there a way to do this with Chronoforms? I suspect it might be along the lines of dynamic validation that would require some javascript and whatever else, but I'm thinking there could be a form action after submit that checks to see if one of the fields is completed.
Any thoughts?
Hi dlwilson007,
Just add a custom validtaion rule for each one of them and use a code like the one below for the custom function:
Where "ID_OF_THE_OTHER_ONE" is the field id of the other field, you need 2 functions of this, with different names, assigned for the 2 fields!
Regards,
Max
Just add a custom validtaion rule for each one of them and use a code like the one below for the custom function:
function checkOne(elem){
if(elem.val() || $("#ID_OF_THE_OTHER_ONE").val()){
return true;
}
return false;
}
Where "ID_OF_THE_OTHER_ONE" is the field id of the other field, you need 2 functions of this, with different names, assigned for the 2 fields!
Regards,
Max
This topic is locked and no more replies can be posted.