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:


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -