Skip to content

Instantly share code, notes, and snippets.

@lucianobragaweb
Last active February 19, 2022 12:55
Show Gist options
  • Save lucianobragaweb/7255519 to your computer and use it in GitHub Desktop.
Save lucianobragaweb/7255519 to your computer and use it in GitHub Desktop.
Enviar Formulário através de um link, tag <a>
<!-- Script que executa a ação de enviar o formulário -->
<script>
function enviar_formulario(){
document.formulario.submit();
}
</script>
<!-- O Formulário -->
<form action="pagina.php" method="post" name="formulario">
<input type="text" name="nome"/>
<input type="text" name="email"/>
</form>
<!-- O Link pode estar fora do formulário ou dentro, funciona da mesma forma -->
<a href="javascript:enviar_formulario()">Clique aqui para enviar!!</a>
@MatheusHonorato
Copy link

MatheusHonorato commented May 2, 2018

thank you use in my website portalonplace.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment