Clear history of a page JQM
Hi folks !
I'm developping a webapp using JQM.
I have a "sequentail" pages something like that :
index.html=>#page1>#page2>#page3>#page1.1>#page1.2>#page2.1>#page2.3...etc
and in some pages I have this structure :
- <div data-role="page" id="page2.1">
<div data-role="header" data-theme="b">
<h1>My website !</h1>
<a href="#page2" data-icon="back" data-iconpos="notext" data-rel="back">Back</a>
<a href="#search" data-icon="search" data-iconpos="notext" data-transition="fade">Search</a>
</div>
<div data-role="content" data-theme="c">
<div class="content-primary">
<center>
<h3>Welcome to Page 2.1 !</h3>
<p><img src="pics/image.png" height="30%" width="30%" alt="img image1" title="My image" ></p>
</center>
<fieldset data-role="controlgroup">
<select name="choice" id="choice" style="text-align:center;">
<option>Make a choice :</option>
<option value="1">Choice 1</option>
<option value="2">Choice 2</option>
<option value="3">Choice 3</option>
<option value="4">Choice 4</option>
<option value="5">Choice 5</option>
</select>
<select name="choice2" id="choice2" style="text-align:center;">
<option>Make your choice :</option>
<option value="10">Choice 10</option>
<option value="20">Choice 20</option>
<option value="30">Choice 30</option>
</select>
<select name="choice3" id="choice3" style="text-align:center;">
<option>Make another choice :</option>
<option value="100">Choice 100</option>
<option value="200">Choice 200</option>
<option value="300">Choice 300</option>
<option value="400">Choice 400</option>
<option value="500">Choice 500</option>
</select>
</fieldset>
<p><button onclick="choice()">CALCULATE</button></p>
<center>
<h3><span id="totalcalcul"></span></h3>
</center>
</div>
</div>
<footer>
<div data-role="footer" class="footer-docs" data-theme="c">
<center><p>© 2016 Author - All rights reserved</p></center>
</div>
</footer>
</div>
I would like when user pressed icon "back" contained in the header (or back button in a browser) it clear the "history" of page and RESET the entire fieldset controlgroup.
When user return on this page (2.1) the fields are reset and you can read "Make your choice :"
I don't know if there is a simple solution in JQM or a script will be accepted. In fact every solution is welcomed !
Thx