Good day all, I have got the following question: I have got a multipage webform which is working good exept every step makes webpages reload. Now it is a time to move to a single page with steps. I have studied lots of variation which I could find over the google but got lost :(
The problem is that everypage exept the front step uses data from database, which is selected on previous user input. Can you please provide an example how to handle the form.
Form (simple) details:
Step1.php - simple php query to database for selet fields Step2.php - display options depending on user answers is step1, also store some step1 detailes for future Step3.php - more detailed input depending on step1 and step2 results step4.php verivication, calculation store data in mysql call extrenal scripts
Any ideas? (I know my question can be really easy for a geeks but not for me as I am still learning.
i have tried is the following code:
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
function call() {
var msg = $('#formx').serialize();
$.ajax({
type: 'POST',
url: 'check.php',
data: msg,
success: function(data) {
$('.results').html(data);
},
error: function(xhr, str){
alert('error: ' + xhr.responseCode);
}
});
}
</script>
<form method="post" action="javascript:void(null);" id="formx" onsubmit="call()"> here some data
<input type="submit" value="Submit"/> </form> <div id="results"></div>