Tuesday, 3 September 2013

how to control when click next button ,nothing happen in JQuery by using wizard plug in

how to control when click next button ,nothing happen in JQuery by using
wizard plug in

I'm writing this code to show wizard . I created 4 steps . First step, I
click Next button. Next button processing is working . In the Second Step
(Training Expense), I click next button. But cannot go third step
(Training Arrangement).
Then, I click Previous Button at that time. can go first step (Training
Request). At that time, system can click Next Button any step. Where am i
wrong in my code. Please help me
Thanks
// name of the wizard var wizardID = "TrainingRequestWizard";
// create a new wizard before A1 container - first wizard step
CreateWizard (wizardID, Epf_GetFieldID("A"));
// adding wizard steps
AddWizardStep (wizardID, "1", "Training Request", Epf_GetFieldID("A"));
AddWizardStep (wizardID, "2", "Training Expense", Epf_GetFieldID("E"));
AddWizardStep (wizardID, "3", "Training Arrangement", Epf_GetFieldID("G1"));
AddWizardStep (wizardID, "4", "Submit", Epf_GetFieldID("S"));
$("#" + wizardID).smartWizard(
{
selected: $('#'+Epf_GetFieldID("COURS_TEMP")).val(),
onShowStep: ShowSetpCallback
}
);
function ShowSetpCallback(obj) {
//$('#'+Epf_GetFieldID("COURS_TEMP")).val(obj.attr('rel'));
$('#'+Epf_GetFieldID("COURS_TEMP")).val(obj.attr('rel')-1);
}
// helper functions
//create a new wizard just before "fistStepID" DIV container
function CreateWizard (wid, firstStepID) {
$("#" + firstStepID).before(
$("<div>",{"id": wid, "class":"swMain"})
.append("<ul>")
);
};
// add a new wizard step
function AddWizardStep (wid, stepNum, stepDesc, divContainer) {
var ulList = "#" + wid + " ul";
$(ulList).append(
$("<li>").append(
$("<a>").attr("href", "#step-"+stepNum).append(
$("<label>").attr("class", "stepNumber").html(stepNum)
).append(
$("<span>").attr("class", "stepDesc").html(stepDesc)
)
)
);
$("#"+wid).append(
$("<div>").attr("id","step-"+stepNum)
.append(
$("#"+divContainer)
)
);
};
});

No comments:

Post a Comment