I’ve been trying to trigger an effect through PHP. Basically, when the user enters an invalid password, I want to make the submit button shake. To do that, I need to go through PHP, and attempt to validate the user in my database, if that fails, the following code is supposed to trigger a jQuery effect.
echo'<script>$(".shake").effect("shake", {times:2, distance:3, direction:"right"}, 45);</script>';
I can see why this might not work, but I don’t see another way to do it.
You need AJAX for that. Client asks the server whether the password is correct by AJAX, then in response to the result of that shakes the button (or not). Something like this:
and in
ajax.cgi: