Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <script>
  2. jQuery(document).on("click", "#idofbutton", function(e) {
  3.  
  4. var variable1 = jQuery("input[name='variable1']").val();
  5. var variable2 = jQuery("input[name='variable2']").val();
  6. var variable3 = jQuery("input[name='variable3']").val();
  7. var variable4 = jQuery("input[name='variable4']").val();
  8. var variable5 = jQuery("input[name='variable5']").val();
  9. var variable6 = jQuery("select[name='variable6'] option:selected").val();
  10. var variable7 = jQuery("select[name='variable7'] option:selected").val();
  11.  
  12. jQuery.ajax({
  13. type: 'POST',
  14. url: 'http://xxx.xx.xx.xxx/Admin/.functions/non_agent_api.php?source=http://www.example.com&user=USERNAME&pass=PASSWORD&function=add_lead&lead_id=XXXX&variable4=' + variable4 + '&first_variable3=' + variable3 + '&variable5=' + variable5 + '&variable2=' + variable2 + '&variable1=' + variable1,
  15. success: function(data) {
  16. alert('success - http://xxx.xx.xx.xxx/Admin/.functions/non_agent_api.php?source=http://www.example.com&user=USERNAME&pass=PASSWORD&function=add_lead&lead_id=XXXX&variable4=' + variable4 + '&first_variable3=' + variable3 + '&variable5=' + variable5 + '&variable2=' + variable2 + '&variable1=' + variable1);
  17. },
  18. error: function() {
  19. alert('fail - http://xxx.xx.xx.xxx/Admin/.functions/non_agent_api.php?source=http://www.example.com&user=USERNAME&pass=PASSWORD&function=add_lead&lead_id=XXXX&variable4=' + variable4 + '&first_variable3=' + variable3 + '&variable5=' + variable5 + '&variable2=' + variable2 + '&variable1=' + variable1);
  20. },
  21. });
  22. });
  23. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement