Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9208913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:43:13+00:00 2026-06-18T00:43:13+00:00

I have a simple login form. 2 php files, mobile.login.php and mobile.home.php . You

  • 0

I have a simple login form. 2 php files, mobile.login.php and mobile.home.php. You log in and if the cookie is set you can now access home. The login system works but the page will not change to mobile.home.php, it just shows the login form again. The form is Ajax and here is the code:

<script type="text/javascript">
$('#login').live('pageinit', function() {
    $('form').live('submit', function(e){
        e.stopPropagation();
        e.preventDefault();

        $.post($(this).attr('action'), $(this).serialize(), function(data){
            if(data.success) {
                //$.mobile.changePage($('#home'), { transition: 'slideup'});
                $.mobile.changePage('mobile.home.php', 'slide', false, true);
                e.preventDefault();
            } else {
            alert('Login failed.');
            return false;
            }
       }, 'json');
    });
});
</script>

I have tried numerous things. As you can see I have 2 options to change the page in the code, one commented out. The one that is commented out, nothing happens. The active code changes the url to mobile.home.php but just slides up the login form again. Both mobile.login.php and mobile.home.php have page divs id's.

I can’t seem to figure this out, any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:43:14+00:00Added an answer on June 18, 2026 at 12:43 am

    This should be your problem:

    $.mobile.changePage('mobile.home.php', 'slide', false, true);
    e.preventDefault();
    

    Dont use e.preventDefault(); here, it will prevent a successful transition.

    Here’s a simple example: http://jsfiddle.net/WWfEq/

    Comment/Uncomment e.preventDefault(); to see a difference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data flow for a simple login form. User access controller
so I have a simple login page like this: <fieldset> <legend>Verification</legend> <form method=post action=authentication.php>
I have a simple php - password protecton / login based on a form
I have a simple login form and have jQuery validate replacing the field labels
Basically I have a simple login form. In the database I have a 'last_logged'
I have a simple html login form which is validated with javascript before its
I have a simple app where you can login it looks like this: {{#view
I have a simple file-system-ed-login (not mysql) just to track number of users who
I'm trying to use javascript validation for a simple login form. Right now I'm
I have a simple login form and it does return the success text in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.