I have a problem that I don't seem to be paving the way with.
To begin with, I have a website that was created by a professional, and we no longer have a working relationship with this company. I am currently managing the site. I am capable, but by no means am I an experienced web developer.
Reference Information. We have an application procedure that uses a multi-page form submitted to the end user. The form is presented in 7 steps, but all this is done from one php file, using (I think) jquery / javascript to complete the steps and check some fields. At the last stage, a summary is proposed for the user. It works great.
Below I find this to be the appropriate javascript that handles page looping:
<script>
$(function () {
window.confirmLeave = true;
$('.datefield').datepicker();
var cache = {};
$("#appForm").bind("step_shown", function(event,data){
if(data.isLastStep){
$("#summaryContainer").empty();
$.each(data.activatedSteps, function(i, id){
if(id === "summary") return;
cache[id] = $("#" + id).find(".input");
cache[id].detach().appendTo('#summaryContainer').show().find(":input").removeAttr("disabled");
});
}else if(data.previousStep === "summary"){
$.each(cache, function(id, inputs){
var i = inputs.detach().appendTo("#" + id).find(":input");
if(id === data.currentStep){
i.removeAttr("disabled");
}else{
i.attr("disabled","disabled");
}
});
cache = {};
}
});
</script>
I also added the html form below:
<form name="appForm" id="appForm" action="submit-app-exec.php" method="post"
enctype="multipart/form-data" autocomplete="off" onSubmit="showProgressBar()">
<fieldset class="step" id="page_1">
<div class="input">
<?php include("add-company/step1.html"); ?>
</div>
</fieldset>
<fieldset class="step" id="page_2">
<div class="input">
<?php include("add-company/step2.html"); ?>
</div>
</fieldset>
<fieldset class="step" id="page_3">
<div class="input">
<?php include("add-company/step3.html"); ?>
</div>
</fieldset>
<fieldset class="step" id="page_4">
<div class="input">
<?php include("add-company/step4.html"); ?>
</div>
</fieldset>
<fieldset class="step" id="page_5">
<div class="input">
<?php include("add-company/step5.html"); ?>
</div>
</fieldset>
<fieldset class="step" id="page_6">
<div class="input">
<?php include("add-company/step6.html"); ?>
</div>
</fieldset>
<fieldset class="step" id="page_7">
<div class="input">
<?php include("add-company/step7.html"); ?>
</div>
</fieldset>
<fieldset class="step" id="summary" >
<span class="font_normal_07em_black">Summary page</span><br />
<p>Please verify your information below.</p>
<div id="summaryContainer"></div>
</fieldset>
<div id="wizardNavigation">
<button class="navigation_button" onclick="javascript:saveApp()">Save</button>
<input class="navigation_button" id="back" value="Back" type="reset" />
<input class="navigation_button" id="next" value="Next" type="submit" onclick="javascript:noSaveApp()" />
<div class="clearFix"></div>
</div>
, :
class="step ui-formwizard-content ui-helper-reset ui-corner-all" style="display: none;"
firebug , : none; "" .
: - , . . "", javascript , php , POST MySQL. , , POST POSTing . , , POSTED. . .
EDIT:
:
$(function(){ $('#appForm').formwizard('show','" . $row["current_step"] . "'); });
. , , . , , , , , "data.activatedSteps" , . , ? . -