$("#sample").live('pageinit', function() {
$("#loginForm").on("submit",handleLogin);
$.mobile.allowCrossDomainPages = true;
});
function handleLogin() {
var form = $("#loginForm");
var u =document.getElementById("User Name").value;
var p = document.getElementById("password").value;
if(u !="" && p!= "")
{
$.mobile.changePage( "#page2" );
}
}
</script>
</head>
<body >
<div data-role="page" id="sample" data-theme="c">
<div data-role="header" data-position="fixed">
<h1>page1</h1>
</div>
<form id="loginForm" method = "post">
<div data-role="fieldcontain">
<label for="User Name">User Name:</label>
<input type="text" name="User Name" id="User Name" />
</div>
<div data-role="fieldcontain">
<label for="password">Password:</label>
<input type="password" name="Password" id="password" value="" />
</div>
<div class="ui-grid-a">
<div class="ui-block-a">
<input type="submit" value="Login" id="submitButton">
</div>
<div class="ui-block-b"></div>
</div>
</form>
<br>
<br>
<br>
<div data-role="footer" data-position="fixed">
<h4>Page1</h4>
</div>
</div>
this is the code ... please modify..