Beginner in jquery ajax. I would like to retrieve datas (this part of the job is done and ok) AND to pass them from step1 to step2 of my form.
My code for the moment is : I've tried to show with #step2 #check-ok the place where I want my datas after phase1 display none and phase2 appear but not working : my datas stay on step1.
$(".open1").click(function() {
if (v.form()) {
var data = {
'civility' : jQuery("input[name=civility]:checked", "#to-bc-clt").val(),
'society' : jQuery('#society').val(),
'firstName' : jQuery('#firstName').val(),
'lastName' : jQuery('#lastName').val(),
'email' : jQuery('#email').val(),
};
jQuery.ajax({
url : '/mySite/VerifRep/parsers/check.php',
method : 'POST',
type : 'POST',
data : data,
success : function(data){
if (data != 'passed') {
jQuery('#messages-errors').html(data);
}
if (data == 'passed') {
$(".frm").hide("fast");
$("#step2").show("slow");
$(".open1").css("display","none");
$(".open2").css("display","inline-block");
$("#step 2 #check-ok").val(data);
// Try that way too but not work --> $("#check-ok").html(data);
}
},
error : function(){
alert('Something wrong.'); }
});
}
});