@TISUCHI - Thanks @tisuchi, The external web site is not an API. Actually, I need to store form data on two websites one is mine another is different. First, I'm stored data on my website than trying to send form data to the external site. can anyone suggest me any alternative solution for this.
var url = "{{ url('contactus') }}";
function OnButton1(){
document.contactus_form.action ="https://externalsite/page.php";
document.contactus_form.submit();
setTimeout(function(){
document.contactus_form.action = url;
document.contactus_form.submit();
},200);
}
here im using setTimeout function, it's working but sometimes not working due to the server load time. that's why im searchin another solution i.e, submit second action from controller.