formvalidation plugin - How to dynamically change validators at runtime -
let's have validation in 1 field:
between: { min: 50, max: 500, message: 'please enter correct range' } i update min , max @ runtime. how can ?
thanks.
you can using updateoption method.
see following code:
$('#yourform') // update min & max options .formvalidation('updateoption', 'yourinputname', 'between', 'min', 10) .formvalidation('updateoption', 'yourinputname', 'between', 'max', 90) // update message if need .formvalidation('updateoption', 'yourinputname', 'between', 'message', 'your new message') // might need revalidate field .formvalidation('revalidatefield', 'yourinputname'); # working example:
# refferences:
updateoptiondocs: http://formvalidation.io/api/#update-option
Comments
Post a Comment