I’m looking to find a way to force field validation on 3 different fields on my page:
Phone Field: XXXXXXXXXX (must be 10 numeric values only)
Zip Code: XXXXX (must be 5 numeric values only)
DOB: must be MM/DD/YYYY format only
Help!!
I’m looking to find a way to force field validation on 3 different fields on my page:
Phone Field: XXXXXXXXXX (must be 10 numeric values only)
Zip Code: XXXXX (must be 5 numeric values only)
DOB: must be MM/DD/YYYY format only
Help!!
Could you include the URL to the page so we can inspect?
It might be helpful to see what is going on within the page.
Of course - here’s the URL. It’s page 2 of a multi-step form. I’m just looking to have the DOB form make sure users enter it as MM/DD/YYYY, since that’s how the data needs to be fed into the CRM system.
https://quote.t65medicareenroll.com/step-two-1/
Here’s the URL for the first page in the group, just for reference.
Okay I think there is an issue with the old jQuery. Try using this script instead.
<script>
window.ub.form.customValidators.validatedob = {
isValid: function(value) {
return /^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/.test(value);
},
message: 'Please enter a date in this format: MM/DD/YYYY',
};
</script>
<script>
window.ub.form.validationRules.date_of_birth.validatedob = true;
</script>
Referencing this post in the community:
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.