i got a jquery function that controls that all the required fields of my form are filled and it cancels submission if one of the required fields are empty.
Canceling the form submission works fine, problem is that when i submit my form after a failed submission it stills cancels the form submission, when it should allow the submit because all the form is filled correctly, here is the code:
-Cancel is a bool that indicates if all the form fields are filled.
if (cancel)
{
$('#form_login').submit(function ()
{
return false;
});
}
else
{
$('#form_login').submit(function ()
{
return true;
});
};
what am i doing wrong ??
thanks