as with a button preload a text in a text box and with the same button generate the search in html-php-mysql

0

The problem is as follows, as with a button preload a text in a text box and with the same button generate the search in html-php-mysql. Try several options to send the "POST" but empty I can not load the English text in the text box with the English-button I can not solve it, here's a short code I hope you can help me greetings and thanks.

<form method="POST" action="" onSubmit="return validarForm(this)">

  <input type="text" placeholder="Ingrese Nombre-Apellido-Idioma" name="palabra" style="height:30px; width:260px" autofocus>

      <input type="submit" value="Buscar" name="buscar">

         <div>


    <br><br><h3>Busquelo por idioma</h3>
    <input type="submit" class="" name="buscar" value="Inglés" style="height:30px; width:95px" />
    <input type="submit" class="" name="buscar" value="Italiano" style="height:30px; width:95px" />

    
asked by Kevin 05.07.2018 в 16:45
source

1 answer

0

SOLVED to this problem, I was on the right track but I needed to correct some details so that I can give them the solution and how to solve it. Hello, I hope this little code helps you.

<form method="POST" action="" onSubmit="return validarForm(this)" name="f1" id="f1">

                            <input type="text" placeholder="Ingrese Nombre-Apellido-Idioma" name="palabra" id="palabra" autofocus>

                            <input type="submit" value="Buscar" name="buscar">

                                <div>


                                <br><br><h3>Busquelo por idioma</h3>
                                //aca el boton para envio y ejecute el codigo para rellenar la caja de texto
                                <input type="submit" class="" name="buscar" value="Inglés" onclick="ingles(ingles)"/>

                                </div>
                        </form>
                       //aca el pequeño codigo para llenar la caja de texto
                        <script type="text/javascript">
                                    function ingles(ingles){
                                        a="ingles";
                                    document.f1.palabra.value=a; 
                                        }
                                </script>
    
answered by 05.07.2018 в 22:56