Advertisement
Guest User

Untitled

a guest
Sep 17th, 2017
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Test Form Builder</title>
  5. <meta charset="utf-8">
  6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  7. <!-- External JavaScript Libraries -->
  8. <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
  9. <script type="text/javascript" src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  10. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  11. <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.3.1/jquery.cookie.min.js"></script>
  12. <script type="text/javascript" src="//js.jotform.com/JotFormAnywhere.js"></script>
  13.  
  14. <!-- Local JavaScript Libraries -->
  15. <script type="text/javascript" src="js/libs/JotForm/JotForm.js"></script>
  16. <script type="text/javascript" src="js/libs/JotForm/JotForm.min.js"></script>
  17. <script type="text/javascript" src="js/libs/JotForm/FormPicker.js"></script>
  18. <script type="text/javascript" src="js/libs/JotForm/FormPicker.min.js"></script>
  19.  
  20. </head>
  21. <body>
  22. <script type="text/javascript">
  23. JF.initialize({
  24. // remember user on next visit by cookie
  25. // default: false
  26. enableCookieAuth: true,
  27.  
  28. // it will be visible on login window
  29. // default:hostname of your site
  30. appName: "GPTQ FormBuilder",
  31.  
  32. // can be "readOnly" or "full"
  33. // default: readOnly
  34. accessType: 'readOnly'
  35. });
  36. JF.login(
  37. function() {
  38. },
  39. function() {
  40. alert("login failed");
  41. }
  42. );
  43. function loadBuilder() {
  44. JotformAnywhere.launchBuilder({
  45. //editMode: true, // This line of code makes the builder load correctly, but it doesn't funtion fully
  46. formID: "72568546905872"
  47. });
  48. }
  49.  
  50. function insertForm() {
  51. JotformAnywhere.insertForm({
  52. formID: "72568546905872",
  53. insertTo: "#form1",
  54. height: 500,
  55. formEmbedUrl: "https://form.jotform.com/jsform/72568546905872",
  56. putDeleteButton: false
  57. });
  58. }
  59.  
  60. function openFormPicker() {
  61.  
  62. JF.FormPicker({
  63. title: 'Select a form to use as a template',
  64. showPreviewLink: true,
  65. offset: 0,
  66. limit: 100,
  67. multiSelect: false,
  68. infinite_scroll: true,
  69. search: true,
  70. onSelect: function(r) {
  71. if (r.length > 0) {
  72. for (var i = 0; i < r.length; i++) {
  73.  
  74. JotformAnywhere.launchBuilder({
  75. formID: r[i].id // Form to load
  76. });
  77.  
  78. }
  79. }
  80. },
  81. onReady: function() {
  82. console.log('Form modal rendered');
  83. },
  84. onClose: function() {
  85. console.log('Form picker closed');
  86. },
  87. onLoad: function(formList, markup) {
  88. console.log('All forms loaded', formList);
  89. console.log('Forms list HTML markup', markup);
  90. }
  91. });
  92. }
  93. </script>
  94. <div id="content">
  95. <h1>Form Builder Test Page</h1>
  96. <input onclick="insertForm()" title="Load Form" style="width: 250px; display: inline;" type="button" value="Insert form into Page" class="button" />
  97. <input onclick="loadBuilder()" title="Form builder" style="width: 250px; display: inline;" type="button" value="Load form into Form Builder" class="button" />
  98. <input onclick="openFormPicker()" title="Form builder" style="width: 250px; display: inline;" type="button" value="Choose a form to edit" class="button" />
  99.  
  100. <div style="display: block;" class="form-pub" id="form1"></div>
  101. </div>
  102. </div>
  103. </body>
  104. </html>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement