Reputation: 574
I have a register form where visitors can sign up, and when they press the submit button the div containing the register form is being moved slightly to left so that it appears in the middle.
The code doing that works fine, but if the visitor has wrote something wrong in the register form they need to be able to try again, but then the register form will be moved once again, if this is repeated a few times it will move out of the container totally.
How can I trigger a function only once? Here is my current code:
...
$('#form form').submit(function(){
// Some code for showing "loading" image etc..
});
Upvotes: 1
Views: 3478