TheDeanVanGreunen

page1.html

Feb 13th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         $('.campaignstrategy input[type=checkbox]').each(
  24.             function(index, value){
  25.             if($(this).is(':checked')){
  26.                 table_info.push(
  27.                     {
  28.                         name: $(this).attr('name'),
  29.                         value: $(this).attr('value'),
  30.                     }
  31.                 );
  32.             }
  33.         });
  34.         let base64str=btoa(JSON.stringify(table_info));
  35.  
  36.         window.location = "page2.html?table_data=" + base64str;
  37.         });
  38.     </script>
  39. </body>
  40. </html>
Add Comment
Please, Sign In to add comment