0
Hello I’m new in these code things and wanted to know how I make to appear the success message after I give Submit, I want those messages that appear the green field, like a div and edit with css. And I also wish that after giving Submit appear another button like a download button
<!DOCTYPE html>
<html>
<head>
<meta "charset=utf-8" />
<title>Cadastro</title>
<link rel="stylesheet" type="text/css" href="assets/css/theme.css"/>
<script src="assets/js/jquery.js"></script>
<!--Arquivo Ajax-->
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#ajax_form').submit(function(){
var dados = jQuery( this ).serialize();
jQuery.ajax({
type: "POST",
url: "newsletter-form.php",
data: dados,
success: function envio()
{
var cont = "Email enviado com sucesso";
document.getElementById("msg").innerHTML = cont;
}
});
return false;
});
});
</script>
</head>
<body>
<div class="for"
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<form id="ajax_form" name="signup" method="post" action="cadastro.php">
<div class="form-group">
<input type="text" id="name_user" class="form-control" name="nome" required placeholder="Seu nome"/>
</div>
<div class="form-group">
<input type="email" id="email_user" class="form-control" name="email" required placeholder="Seu email"/>
</div>
<div class="form-group">
<input type="tel" id="telefone_user" class= "form-control" name="telefone" required placeholder="Seu telefone"/>
</div>
<button class="btn btn-primary btn-block btn-register">
Enviar
</form>
<!-- coloco as divs que quero o resultado como hidden -->
<div class="menu" hidden>enviado com sucesso!</div>
<div id="atuar" hidden ><a href="https://google.com"><input type="button" value="download"></a></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
Hello Leonardo, the focus of Stack Overflow is questions about programming that are strongly related to a specific problem.
– user60252
Please help me just in this I spent weeks trying
– Leonardo
Have you tried a search here on the site? It’s full of posts about this
– user60252
I’ve looked and I can’t find :(
– Leonardo
At least put there in the question the HTML form
– user60252
click edit and paste the HTML, if it gets bad I hit it
– user60252
Okay, I made an example for you!
– user60252