1
How to put the text in a php variable and not the value of an option? If it is java script, still as I put the text in the variable, because I need to work with this text.
html example:
<select name="uf" id="uf">
<option value="1">AC</option>
<option value="2">AL</option>
<option value="3">AM</option>
</select>
after Submit I can only get the value:
$idestado = $_POST['UF'];
how I put the text in this variable:
$nomeestado = ???
Where does this HTML come from? Because you have numbers in value and not the same as
.innerHTML? If you don’t need value in Javascript it’s best to have the same in both... or take value.– Sergio
I use numbers in value because I select cities by state id.
– Álysson Alexandre
Okay, either you use AJAX or I suggest you change what you have in value to use in JS and server. Otherwise form Submit only sends value...
– Sergio
ok, so how do I do in AJAX?
– Álysson Alexandre
@Ályssonalexandre you are using js to pick the right cities?
– RodrigoBorth
------------yes.
– Álysson Alexandre