Validation plugin hijacks click function?
Absolute newbie question, any help is highly appreciated :)
I am using curvycor开发者_StackOverflowners (http://www.curvycorners.net/) in combination with the jQuery validation plugin (http://bassistance.de/jquery-plugins/jquery-plugin-validation/), and I'm having problems getting the div to redraw the rounded corners when I do like this:
$("input[type='submit']").click(function(e) {
curvyCorners.redraw();
});
When I click the submit-button the first time the form validates, the validation error-message pops up and expands the div, causing the layout to go ugly. However when I click on it the second time the rounded corners redraw nicely.
Could it be that my validation plugin hijacks my initial click? How do I go about this? Any hint is very much appreciated.
Make sure that the handler you have above is set before the validation code is called. Event handlers are executed in the order they were bound, so if the validation plugin is cancelling the event, then you want to be attached before it does so.
In short, attach your handler first to make sure it gets executed and something else doesn't interfere.
Disclaimer: This isn't always true, something trying to interfere can (.unbind()
for example) but it should solve your issue. If you see the same behavior after doing this, please provide more detail, something else is interfering.
精彩评论