TheDeanVanGreunen

page1.html

Feb 17th, 2020
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Page 1</title>
  7. </head>
  8. <body>
  9. <div class="campaignstrategy">
  10. <h1>1. Campaign Strategy</h1>
  11. <input type="checkbox" name="awareness" id="awareness_checkbox" value="0.01">Awareness<br>
  12. <input type="checkbox" name="directresponse" id="directresponse_checkbox" value="0.01">Direct Response<br>
  13. <button id="next_page_button">Next Page</button>
  14. </div>
  15. <script
  16. src="https://code.jquery.com/jquery-3.4.1.min.js"
  17. integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
  18. crossorigin="anonymous">
  19. </script>
  20. <script>
  21. $('#next_page_button').click(function(){
  22. let table_info = [];
  23. // Do for checkboxes
  24. $('.campaignstrategy input[type=checkbox]').each(
  25. function(index, value){
  26. if($(this).is(':checked')){
  27. table_info.push(
  28. {
  29. name: $(this).attr('name'),
  30. value: $(this).attr('value'),
  31. type: 'checkbox'
  32. }
  33. );
  34. }
  35. });
  36. $('.campaignstrategy input[type=text]').each(
  37. function(index, value){
  38. table_info.push(
  39. {
  40. name: $(this).attr('name'),
  41. value: $(this).attr('value'),
  42. type: 'text'
  43. }
  44. );
  45. });
  46. let base64str=btoa(JSON.stringify(table_info));
  47. window.location = "page2.html?table_data=" + base64str;
  48. });
  49. </script>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment