Can we have a form with fields from different pages in multipage document in jquery mobile? -
i have multi page document in jquery mobile. page 1 has link redirects me page 2. page 2 has button submit request server. possible create form have form fields spread in both page 1 , page2 , when submit form fields in both pages submitted. multi page document in jquery mobile support this? or there other way easily?
yes, can.
the long page forms can spread on 2 pages in same html shown in following code.
<body> <form action="/m/processorder.php" method="post"> <div data-role="page" id="delivery"> <?php $headertitle = "deliver to"; ?> <?php include("includes/header.php"); ?> <div data-role="content"> <h2>where delivering?</h2> <!—-form elements go here --> <p> <div class="ui-grid-a"> <div class="ui-block-a"><a data-role="button" href="index.php">cancel</a></div> <div class="ui-block-b"><a data-role="button" href="#payment">continue</a></div> </div> </p> </div> <?php include("includes/footer.php"); ?> </div> <div data-role="page" id="payment"> <?php $headertitle = "payment"; ?> <?php include("includes/header.php"); ?> <div data-role="content"> <h2>please enter payment information</h2> <!-—form elements go here --> <p> <div class="ui-grid-a"> <div class="ui-block-a"><a data-role="button" data-theme="d" href="index.php">cancel</a></div> <div class="ui-block-b"><input type="submit"data-theme="b" value="submit"/></div> </div> </p> </div> <?php include("includes/footer.php"); ?> </div> </form> <body>
multiple data-role="page"
can exist in single dom. official jqm documentation
a html document may start single "page" , ajax navigation system load additional pages on demand dom users navigate around. alternatively, html document can built multiple "pages" inside , framework transition between these local views no need request content server.
here link documentaion.
the code snippet creating mobile apps jquery mobile shane gliser
Comments
Post a Comment