How to create a dropdown field

Links for php scripts

Moderators: gesf, Michalio

Post Reply

I am creating a data entry form on my website (that operates via a login system).

This data entry form will have about 7 different entry fields, 4 of which are basic text, and 3 of which must be dropdown selection (prepopulated options). I would like the dropdown selections to be retrieved from a different table within the same database.
Also, how can I go about submitting this information to the database, to be included with the other fields? I have already got the field submission working for the the 4 basic text fields.

This is a place to share and get help in how to write PHP, not to write code for you. Sorry, but I found honesty to be the best policy.

Perhaps I miscommunicated. I wasn't expecting someone to write the code for me. My goal was to obtain some form of reference or be given a direction on what to look for / research. My apologies, if I have incorrectly addressed my issue.

None-the-less, the problem has been sorted out. Is there somewhere specific I could look for these types of answers?

If you are familiar with using PHP to print web page content from a table you're already most of the way there. You just need to use similar logic to create a "<select>" element in your form; you can loop over the rows from your table to create the "<option>" sub elements. I would give each item in your dropdown table an id, then you can use that id as the value of each option.
Post Reply