Closed
Description
Your environment
- Version of
jquery-validate
: 1.19.5 - Browser name and version: Chrome 134
Current behavior
Create a new validation method using the addMethod function.
jQuery.validator.addMethod( 'requireSelection', requireSelectionValidator, $.validator.format('Please select a value from {params.fieldname} list') )
use it in a rule
rules: {
SomeField: {
requireSelection: {
param: {
fieldName: 'Some Field',
list: data.availableCoils.map(x => x.ASSEMBLY_SN_1)
}
}
},
Expected behavior
The {params.fieldname} replace token should be replaced by the params object's specified property.