Reputation: 1241
How can i apply effects to the modal window which contain login form. I want to apply shake effect for the dialog when use submitted the wrong details. This code is failed
$("#dialog-form").effect("shake", { times:5 }, 100);
This is applying the effect to only form not for modal dialog. Is there any way to apply the effect?
Upvotes: 0
Views: 2039
Reputation: 262919
You have to apply the effect to the dialog widget itself. You can write:
$("#dialog-form").dialog("widget").effect("shake", { times: 5 }, 100);
In passing, note that shaking the dialog box in response to invalid input might not be understood by some of your users. I'd suggest you use a clear, understandable validation message instead.
Upvotes: 3