File manager - Edit - /home/wwwroot/camplus.hk/tpbps.camplus.hk/public_html_standalone/assets/custom/jquery-survey/index.html
Back
<html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="js/jquery.js"></script> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/jquery-ui.min.css"> <link rel="stylesheet" href="css/jQuery.Survey.css" > <link rel="stylesheet" href="css/bootstrap-theme.min.css" > <script src="js/jquery-ui.min.js"> </script> <script src="js/bootstrap.min.js"></script> <script type="text/javascript" src="js/template.js"></script> <script type="text/javascript" src="js/handlebars.js"></script> <script type="text/javascript" src="js/jQuery.Survey.js"></script> <script type="text/javascript" src="js/jquery.repeater.js"></script> <script type="text/javascript" src="js/jquery.validate.js"></script> <script type="text/javascript" src="js/survey.js"></script> </head> <body> <h1>Your survey below</h1> <div class="container"> <div class="row"> <form class="col-md-6"> <fieldset id="survey"> </fieldset> </form> <div class="col-md-6"> <textarea id="surveyTA" style="height:500px;width:100%"></textarea> <button id="update">update</button> </div> </div> </div> <script type="text/javascript"> // data is the item to be put into the form var person = {}; $(document).ready(function(){ $("#surveyTA").html(JSON.stringify(default_survey)); init_survey(jQuery.parseJSON($("#surveyTA").val())); $("#update").on("click",function() { init_survey(jQuery.parseJSON($("#surveyTA").val())); }) }); function init_survey (updated_survey) { console.log(updated_survey); $('#survey').survey({ survey: updated_survey, data: person, init: function(target){ target.closest('form').validate({ errorPlacement: function(error, element){ var p = element; if(p && (!p.hasClass('input'))){ p = p.parent(); } error.appendTo(p||element); }, wrapper: 'div' }); }, beforeChange: function(from, to, next){ //Before changing pages var target = this; if(from === void 0){ next(); }else if(target.closest('form').valid()){ var survey = $.survey(target); var data = survey.pageData(); var surveyData = survey.data(); survey.updateData(data); next(); } } }); } </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.2.34 | Generation time: 0.22 |
proxy
|
phpinfo
|
Settings