Is there a code that can validate that one field is greater then another.
I have a mileage start field and a mileage end.
Want to validate the end is entered greater than the start field.
Thanks
fields are mileage_start and mileage_end
I have a mileage start field and a mileage end.
Want to validate the end is entered greater than the start field.
Thanks
fields are mileage_start and mileage_end
Hi har7801,
I don't see anything built in to CFv6 to do this but this FAQ suggests a way to add custom JavaScript and/or PHP validation.
Bob
I don't see anything built in to CFv6 to do this but this FAQ suggests a way to add custom JavaScript and/or PHP validation.
Bob
Following examples of Bob, this worked for my
(inside of multifield areas i have insterted one "javascript custom code" with this function
(inside of multifield areas i have insterted one "javascript custom code" with this function
jQuery.fn.form.settings.rules.customfn = function() {and in validation rules of field2
field1=document.getElementById("field1").value;
field2=document.getElementById("field2").value;
let result = (field1 < field2) ? true:false;
return result;
};
customfn: Error message because field2 must be greater than field1that works fine, thanks Bob
just to add in validation rules of field2
You need to login to be able to post a reply.