0
<TR>
<TD bgcolor="#CCCCCC" class="myinputstyle" size=16 >Cidade:</TD>
<TD>
<select name="cidades" >
<option value=""></option>
<option value="sp">São Paulo</option>
<option value="ca">Curitiba</option>
<option value="fs">Florianopolis</option>
</select>
<INPUT type=text name="cidades" size="16" class="myinputstyle">
</TD>
<TD bgcolor="#EBEBEB" >
</TD>
This code sends the chosen option of the combobox but the value is not saved in the database, if I do not use the combobox the value is sent normally the problem only happens when I use the combobox where this error ?
How do I pass this code that you put inside the input ? pq the input that sends to the bd
– checkmate
Change the
name
of HTML inputs as it is up there. They can never be equal. Then change the PHP $_POST you currently have with the names you defined in HTML.– Alisson Acioli
I did so and it didn’t work <INPUT type=text name="cities" size="16" class="myinputstyle" value="<? php $cidade_select = $_POST['cidades_text']; ?>">
– checkmate
The code I made was for you to send what the user typed and selected to the PHP code. For you to do it this way you have to exchange the cities_text for
cidades
but remembering that the name="" can never be equal in a form. In your case you had put the namecidades
in <select> and <input> this cannot happen– Alisson Acioli
Master did so now tmb keeps giving error do not know what to do <INPUT type=text name="cities" size="16" class="myinputstyle" value="<? php $cidade_select = $_POST['cidades_select']; echo $cidade_select ?>">
– checkmate
I edited the code... do it that way... The form you save in a file called formulario.html and the PHP code Voce saves as a test.php and makes the test.
– Alisson Acioli
Master if I download the team view you connect here ? did not work
– checkmate
add on facebook. fb.com/Alisson.Acioli
– Alisson Acioli