Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- jQuery(document).on("click", "#idofbutton", function(e) {
- var variable1 = jQuery("input[name='variable1']").val();
- var variable2 = jQuery("input[name='variable2']").val();
- var variable3 = jQuery("input[name='variable3']").val();
- var variable4 = jQuery("input[name='variable4']").val();
- var variable5 = jQuery("input[name='variable5']").val();
- var variable6 = jQuery("select[name='variable6'] option:selected").val();
- var variable7 = jQuery("select[name='variable7'] option:selected").val();
- jQuery.ajax({
- type: 'POST',
- 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,
- success: function(data) {
- 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);
- },
- error: function() {
- 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);
- },
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement