Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. echo '<input name="checkbox" value="student" type="checkbox" onclick=change(this, "type"); />';
  4.  
  5. ?>
  6.  
  7. Uncaught SyntaxError: Unexpected token }
  8.  
  9. <script>
  10. function change(cb, year) {
  11. var value = cb.value;
  12. var type = cb.checked;
  13. var yr = year;
  14.  
  15. $.ajax( {
  16. type: 'POST',
  17. url:"process.php",
  18. data: { 'data':value, 'type':type, 'yr':yr, },
  19. success:function(result) {
  20. console.log("works" + result);
  21. }
  22. });
  23. }
  24. </script>
  25.  
  26. echo '<input name="checkbox" value="student" type="checkbox" onclick="change(this, 'type');" />';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement