Bug Tracker

Opened 15 years ago

Closed 14 years ago

Last modified 12 years ago

#4293 closed bug (invalid)

[validate] unhighlight callback unnecessary execution for checkbox fields

Reported by: supjogi Owned by: joern
Priority: minor Milestone: 1.4
Component: plugin Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:


There is problem when you have registered unhighlight callback and validate checkbox fields.

For example for below code when you click "Check" it show error and add error class in highligh function, but when you click on "Blue" checkbox - error class is removed (unhighlight is executed) but error still exists.




highlight: function(element){



unhighlight: function(element){



errorPlacement: function(error, element){



rules: {

color: {

required: true, minlength: 2



messages: {

color: {

required: "Please select at least two colors"





</script> <style>

.myerror {

color: red;


</style> <form id="colorForm">




<input type="checkbox" name="color" value="1"/>Black <input type="checkbox" name="color" value="2"/> White <input type="checkbox" name="color" value="3"/> Blue<input type="submit" value="Check"/>

</td> <td> </td>




Solution: I have modify function in this plugin to look like below, because there are problem that validated field exists also in validElements and invalidElements because "not" function compare checkbox array with single checkbox and they aren't equal.

validElements: function() {

var that = this; return this.currentElements.map(function() {

return that.findByName(this.name)[0]



Change History (2)

comment:1 Changed 14 years ago by dmethvin

Owner: set to joern

comment:2 Changed 14 years ago by john

Resolution: invalid
Status: newclosed

Please file plugin bugs with the appropriate author on their bug tracker.

Note: See TracTickets for help on using tickets.