How do I return hit form jquery and php

0

I have a form like this

                <form action="envia-contato.php" method="post" >
                    <label>Nome<span style="color:#db0012 !important;">*</span></label>
                    <input type="text" name="nome" id="nome"  />

                    <label>E-mail<span style="color:#db0012 !important;">*</span></label>
                    <input type="text" name="email" id="email" tabindex="2" />

                    <label>Telefone</label>
                    <input type="text" name="telefone" id="telefone" tabindex="3" />

                    <label class="mensagem">Mensagem<span style="color:#db0012 !important;">*</span></label>
                    <textarea name="mensagem" id="mensagem" tabindex="4" ></textarea>

                    <label id="aviso" class=""><p></p></label>

                    <input type="submit" class="btEnviar" value="Enviar" tabindex="6" />
                </form>

How do I get the success message return from php to jquery to show the success message sent email.

            $(document).ready(function() {

                $("#aviso").hide();
                $("form").submit(function() {
                    var checar = 0;

                    if($("#nome").val() == "") {    checar = 1; }
                    else if($("#email").val() == "") { checar = 1; }
                    else if($("#mensagem").val() == "") { checar = 1; }

                    if (checar == 1) {
                        $("#aviso").removeClass('sucesso');
                        $("#aviso").addClass('erro');
                        $("#aviso p").text('Os campos marcados com * s\u00e3o obrigat\u00f3rios.');
                        $("#aviso").fadeIn();
                            return false;
                        }
                    });

            });

    
asked by anonymous 06.09.2018 / 14:50

0 answers