Submitting a form produces unexpected results.

Submitting a form produces unexpected results.

Hi, 

I am building a webapp and everything was going fine until I tried to incorporate a login page. I have used the login script many times before and only seem to be having an issue with jquery mobile. I have all my "pages" on index.php and my login div as the first page. (I also tried having it as the last 'page' with the same results). With the Form action as index.php after input validation it always puts me in the last 'page' (div) in the list. If you change my Form Action to #menu (which is where I want it to be directed to) it displays all 'pages' at the same time on the page (I even tried action=index.php#menu with no luck). If I need to ill post all my code but hopefully just my login page should be enough. 

<div data-role="page" data-theme="b" id="login"> 
<div data-role="header" data-position="inline" data-theme="b" data-nobackbtn="true">
<h1>Mobile App</h1>
</div>
<div data-role="content"> 
<font color="red"><?php echo $error_msg; ?></font>
<form action="index.php" method="post">
<div data-role="fieldcontain" >
<label for="username">Username:</label>
<input type="text" name="username" id="username"  />
</div>
<div data-role="fieldcontain">
<label for="password">Password:</label>
<input type="password" name="password" id="password" />
</div>
<fieldset class="ui-grid-a">
<div class="ui-block-b"><button type="submit" data-theme="b" >Login</button></div>
</fieldset>
</form>
</div>
</div>

Any help is much appropriated.

Thank You
Yoni Hirsch