Send form to two locations and redirect

0

I need the script to send my form to two locations and after sending it to the response page.

<script type="text/javascript">
	function EnviaForm2()
	{
		document.getElementById('formnewsletter').action = 'https://docs.google.com/forms/d/e/1FAIpQLSc-wUHrhJZxfdWB7Ia_-8FxPU7o4KiL0pqVtnV0Miay_h9XxQ/formResponse';
		document.getElementById('formnewsletter').submit();
	}
	function enviaForm(nome,email){
		$.ajax(
				{
				  type: "POST",
				  url: "enviar.php",
				  data: "&nome="+nome+"&email="+email,
				  beforeSend: function() {
				  },
				  success: function(txt) {
					if(txt.status=='success')
						window.location.href = "https://www.paginaresposta.com";
						else
						alert("E-mail não cadastrado.");
						EnviaForm2();
				  },
				  error: function(txt) {
				  }
				}
			);
	}
</script>
    
asked by anonymous 24.09.2017 / 04:42

0 answers