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

<script type="text/javascript">
Raph El's avatar
Raph El committed
13
	var paramsInput = <?php echo json_encode($input); ?>;
Raph El's avatar
Raph El committed
14 15 16 17 18
	jQuery(document).ready(function() {
	    mylog.log("render form input","/modules/costum/views/tpls/forms/cplx/validate.php");
	    $("#validation<?php echo $kunik ?>").click(function(){
			var params = {
				answerId : answerId,
Raph El's avatar
Raph El committed
19 20
				answer : answerObj.answers,
				input : paramsInput
Raph El's avatar
Raph El committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
			};

			ajaxPost(
		        null,
		        baseUrl+"/survey/answer/validate",
		        params,
		        function(data){
		        	toastr.success("Le formulaire à été soumis");    
		        },
		        function(data){
		        	toastr.error("Un soucis est apparue. Contacter l'administrateur");    
		        }
		    );

		});
	});


	
	
</script>
<?php } ?>