Craig Hopson Posted December 11, 2012 Share Posted December 11, 2012 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] Link to comment Share on other sites More sharing options...
Question
Craig Hopson
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
Link to comment
Share on other sites
0 answers to this question
Recommended Posts