I have this fantastic little plugin working but I need to require that at least one name be selected. I normally use jquery.validate. However, the validation plugin does not appear to work on a field using the tokeninput. Does anyone have an answer? As always, thanks so much for your help.
$("#NewMessage").validate({
rules: {
name: {
required: true
}
}
});
$("#name").tokenInput("lookup.cfc?method=getNames&returnFormat=json", {
hintText: "Type in the name of recipient(s)",
noResultsText: "No results",
searchingText: "Searching..."
})
I had the same issue and solved it overriding ignore (apparently the problem is that tokenInput hides the original input and by default "validate" doesn't validate hidden inputs)
$("#NewMessage").validate({
ignore: "",
rules: {
name: {
required: true
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With