Sign in to follow this  
Followers 0
Craig Hopson

Jquery mobile, phonegap pagechange

1 post in this topic

hi i wish to get a variable from the form (page1) onsubmit switch to (page2) and display value here is what i have but i cant get it to work, i get the "alert(Device_ID); " all fine but wont redirect


<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery-mobile.css" />
<script type="text/javascript" src="js/cordova-2.2.0.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-mobile.js"></script>
<title>CHTracker</title>
<script>

function LogID(Form) {
var Device_ID = Form.tracking_ID.value;
alert(Device_ID);
$.mobile.changePage( "#page2", { transition: "slideup"} );
}
</script>

</head>
<body>

<!-- Start of second page -->
<div data-role="page" id="page1">
<div data-role="header">
<h1>CHTracker</h1>
</div><!-- /header -->
<div data-role="content">
<p>Please enter tracking ID:-</p>
<p>

<form method="post" data-ajax="false" onSubmit="LogID(this);">
<div data-role="fieldcontain">
<label for="tracking_ID">Tracking ID:-</label>
<input type="text" name="tracking_ID" id="tracking_ID" />
</div>
<input type="submit" value="Login" />
</form>
</div><!-- /content -->
<div data-role="footer" data-position="fixed">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->

<!-- Start of second page -->
<div data-role="page" id="page2">
<div data-role="header">
<h1>CHTracker</h1>
</div><!-- /header -->
<div data-role="content">
<p>SOMETRACKING</p>

</div><!-- /content -->
<div data-role="footer" data-position="fixed">
<h4>Page Footer</h4>
</div><!-- /footer -->
</div><!-- /page -->

</body>
</html>
[/CODE]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.