3
Answers

How to submit two url in single click ?

dip vyas

dip vyas

4y
696
1
i have tried trigger Event but it not work...
Answers (3)
2
Laxmidhar Sahoo

Laxmidhar Sahoo

NA 10.4k 55.4k 4y
hi
 
Define the bellow function with two ancher element with two url as href attribut.
 
call the function on button click event
 
  1. function singleclick()  
  2. {  
  3. var link1 = document.createElement("a");  
  4. var link2 = document.createElement("a");  
  5. link1.href = "http://test1.com";  
  6. loink2.href = "http://test2.com";  
  7. link1.click();  
  8. link2.click();  
  9. }  
Thanks and Regards 
1
Ankit Kanojia

Ankit Kanojia

245 7.8k 1.9m 4y
HTML
  1. <a href="#" class="yourlink">Click Here</a> 
JAVASCRIPT
 
  1. $('a.yourlink').click(function(e) {  
  2.     e.preventDefault();  
  3.     window.open('http://yoururl1.com');  
  4.     window.open('http://yoururl2.com');  
  5. }); 
 
 Might be this can be helpful to you.
 
 
 
1
Farhan Ahmed

Farhan Ahmed

63 28.3k 15.4m 4y
https://css-tricks.com/separate-form-submit-buttons-go-different-urls/