Here is the Code: <form id="form" method="POST" onSubmit="return submitForm()" data-ajax="false"> <div class="XYZinfo"> <label><b> XYZ Information</b></label><hr> <label for="firstname">First Name:</label> <input type="text" name="firstname" id="firstname" value="" placeholder=""> <label for="lastName">Last Name:</label> <input type="text" name="lastname" id="lastName" value="" placeholder=""> <label for="address">Address:</label> <input type="text" name="address" id="address" value="" placeholder=""> <label for="apt">Apt:</label> <input type="text" name="apt" id="apt" value="" placeholder=""> <label for="city">City:</label> <input type="text" name="city" id="city" value="" placeholder=""> </div> </form> and the javascript code which i am using in the submit form is : function submitForm() { var fname= $("[id='firstname']").val(); var lname= $("[id='lastname']").val(); var _address= $("[id='address']").val(); var _apt= $("[name='apt']").val(); var _city= $("[name='city']").val(); window.localStorage.setItem("firstname",fname); window.localStorage.setItem("lastname",lname); window.localStorage.setItem("address",_address); window.localStorage.setItem("apt",_apt); window.localStorage.setItem("city",_city); if(fname == " ") { alert('please the first name'); return false; } else { $.mobile.changePage("#page2",{ reverse:false, transition:"slide"}); $("#buyerData").html("FirstName:" + window.localStorage.getItem("firstname") +"<br>"+ "<br>LastName:" + window.localStorage.getItem("lastname") + "<br>" + "<br>Address:" + window.localStorage.getItem("address") +"<br>"+ "<br>Apt:" + window.localStorage.getItem("apt") +"<br>" + "<br>City:" + window.localStorage.getItem("city") ); return true; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)