Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <script src="jquery.js" type="text/javascript"></script>
  2. <script type="text/javascript">
  3. $(document).ready( function() {
  4. function StuffSelect(id) {
  5. document.getElementById(id).focus();
  6. document.getElementById(id).select();
  7. }
  8. $('#chatform').submit( function() {
  9. var data = []
  10. $('#chatform :input').each( function() {
  11. var key = $(this).attr('name');
  12. var val = $(this).attr('val');
  13. data[key] = val;
  14. });
  15. $.ajax( { url : 'index.php',
  16. type : 'POST',
  17. data : data,
  18. }
  19. success : function(data) {
  20. alert('yes');
  21. }
  22. error : function(data) {
  23. alert("something went wrong");
  24. }
  25. );
  26. return false;
  27. });
  28. );
  29. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement