Jump to content
Fórum Script Brasil
  • 0

Enviar Dois Forms


sssilvio

Question

10 answers to this question

Recommended Posts

  • 0
<html>
<head>
<title>teste</title>
<script language="JavaScript" type="text/javascript">
	function envia(){
  document.form1.submit();
  document.form2.submit();
	}
</script>
</head>

<body>
<form name="form1" method="post" action="recebeForm.jsp">
  <input name="nome" type="text" id="nome" value="form1 nome" >
</form>
<form name="form2" method="post" action="recebeForm.jsp">
  <input name="endereco" type="text" id="endereco" value="form2 endereco">
  <input name="Submit2" type="button" onClick="javaScript:envia();" value="enviar">
</form>
</body>
</html>

Link to comment
Share on other sites

  • 0

<form name="form1" method="post">
  <input name="nome" type="text" id="nome" value="form1 nome" >
	<form name="form2" method="post">
   <input name="endereco" type="text" id="endereco" value="form2 endereco">
   <input name="Submit2" type="button" onClick="javaScript:envia(form1.nome.value);" value="enviar">
	</form>
</form>

Isto da erro de script!

Link to comment
Share on other sites

  • 0

Aff... Até onde eu sei, não se pode colocar um form dentro do outro. E não entendi a lógica de se ter dois forms aí? Se vão ser enviados para o mesmo script, com campos diferentes, porque não criar um apenas?

Abraços

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.8k
×
×
  • Create New...