automatically selecting list option from mysql table
Question:
hello. I'm new to php (and coding in general) so please bare with me as I try to explain this the best I can. I have a form that I want to be able to update the data after a user has submitted it to a mysql table. I know how to make the data from the text areas reappear. What I don't know how to do is make the lists automatically select the option that was chosen the form was first submitted. anyone that can help me? If you need more info let me know, I'll try to clarify more.
Answers:
It should be simple as the textarea.
When you create the drop down box , you can pre select the already submitted value.
example,
YOu can post you have got thus far. we can assist you on this.
hello. I'm new to php (and coding in general) so please bare with me as I try to explain this the best I can. I have a form that I want to be able to update the data after a user has submitted it to a mysql table. I know how to make the data from the text areas reappear. What I don't know how to do is make the lists automatically select the option that was chosen the form was first submitted. anyone that can help me? If you need more info let me know, I'll try to clarify more.
Answers:
It should be simple as the textarea.
When you create the drop down box , you can pre select the already submitted value.
example,
| Code: |
| <select name="mydropdown">
<option value="some value"<?if ($databaserow["dbfield"]=="some value"){echo " selected";}?>>display value</option> </select> |
YOu can post you have got thus far. we can assist you on this.
Commentaires
Enregistrer un commentaire