validationForm.php 1.15 KB
Newer Older
Raph El's avatar
Raph El committed
1
<?php 
2

Raph El's avatar
Raph El committed
3
if($mode != "pdf"){
4
	var_dump($input);
Raph El's avatar
Raph El committed
5 6
?>
<div class="">
7
    <label for="validation<?php echo $kunik ?>"><h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn ?></h4></label>
Raph El's avatar
Raph El committed
8
    <div class="text-center">
9
    	<a href="javascript:;" class="btn btn-primary" id="validation<?php echo $kunik ?>">Validation</a>
Raph El's avatar
Raph El committed
10 11 12 13
    </div>
</div>

<script type="text/javascript">
Raph El's avatar
Raph El committed
14
	var paramsInput = <?php echo json_encode($input); ?>;
Raph El's avatar
Raph El committed
15 16
	jQuery(document).ready(function() {
	    mylog.log("render form input","/modules/costum/views/tpls/forms/cplx/validate.php");
17 18
	    $("#question<?php echo $key ?> #validation<?php echo $kunik ?>").off().click(function(){
			var paramsValidate = {
Raph El's avatar
Raph El committed
19
				answerId : answerId,
Raph El's avatar
Raph El committed
20 21
				answer : answerObj.answers,
				input : paramsInput
Raph El's avatar
Raph El committed
22 23 24 25 26
			};

			ajaxPost(
		        null,
		        baseUrl+"/survey/answer/validate",
27
		        paramsValidate,
Raph El's avatar
Raph El committed
28 29 30 31 32 33 34 35 36 37 38 39
		        function(data){
		        	toastr.success("Le formulaire à été soumis");    
		        },
		        function(data){
		        	toastr.error("Un soucis est apparue. Contacter l'administrateur");    
		        }
		    );

		});
	});
</script>
<?php } ?>