1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
$(document).ready( function () {
//fermeture fenetre
function CloseWindow() {
var obj_window = window.open('', '_self');
obj_window.opener = window;
obj_window.focus();
opener=self;
self.close();
}
//fin fermeture fenetre
$(function() {
$('#survey_pres').dialog({
position: 'top',
resizable: false,
width: 700,
modal: true,
buttons: {
"Je ne participe pas": function() {
$( this ).dialog('close');
window.open('about:blank','_parent','');
CloseWindow();
},
"Je participe": function() {
//$( this ).dialog( "close" );
$('#survey_pres').dialog('close');
page1();
}//FIN Bouton JE PARTICIPE
},//FIN Boutons
close: function(event, ui) {
CloseWindow();
}
});//FIN dialog survey_pres
function page1(){
$('#survey').dialog({
position: 'top',
resizable: false,
width: 700,
modal: true,
buttons: {
Continuer: function() {
if($("input[class='q1_case']:checked").val() == undefined) {
$(".formError").show();
$("#q1_question").css({ color: "red"});
}
if($("input[class='q2_case']:checked").val() == undefined) {
//FALSE $.post("process_survey.php", $("#popup_survey").serialize());
$(".formError2").show();
$("#q2_question").css({ color: "red"});
}
if($("input[class='q1_case']:checked").val() !== undefined && $("input[class='q2_case']:checked").val() !== undefined ){
$("label").css({ color: ""});
$.post("process_survey.php", $("#popup_survey").serialize());
$(this).dialog('close');
page2();
}
}//FIN Continuer
},//FIN buttons
close: function(event, ui) {
CloseWindow();
}
});//FIN Dialog
}
}); //FIN $function
});//FIN document.ready |
Partager