You use Rails4ClientSideValidation gem to validate you forms.
Problem:
When you programatically change the values of the required fields or any fields with some sort of validation such as ’email’ or ‘phone_number’, the validation message does not disappear.
Solution:
$targetFields.on('focusout', function () { $(this).trigger('focusin'); $(this).val(valueYouWant); $(this).trigger('change'); $(this).trigger('blur'); }
Advertisements