How to avoid this attitude?!
Hi,
I have a sign in form wit ajax as per below code but sometimes it doesn't work and it just goes to this URL:
It is is not frequently happening, maybe once or twice a week only... I am not sure why and when exactly it occurs.but I want to avoid it.
here is the code:
- $("#frmSignin").validate({
- rules:
- {
- txtUserID: { required: true },
- txtPassword: { required: true }
- },
- submitHandler: function (form)
- {
- $.ajax({
- type: 'POST',
- url: "signin.php",
- data: $('#frmSignin').serialize(),
- beforeSend: function()
- {
- $("#btnSignin").parent().hide();
- $("#divUserID").hide();
- $("#divPassword").hide();
-
- $.mobile.loading('show', {theme:"b", text:"Please wait..", textonly: false, textVisible: true});
- },
- success: function(data)
- {
- if (data.match(/true/))
- {
- $.mobile.changePage('my.php', { reloadPage: true, transition: "flow"} );
- }
- else
- {
- $.mobile.loading('hide');
-
- $('#InvalidUserIDPassword').popup();
- $("#InvalidUserIDPassword").popup("open");
-
- $('#txtUserID').val("");
- $('#txtPassword').val("");
- $("#btnSignin").parent().show();
- }
- },
- error: function(jq, status, message)
- {
- alert('A jQuery error has occurred. Status: ' + status + ' - Message: ' + message);
- }
- });
- }
- });