Jump to content

Use database table to fill select element on a form


Gilbert

Recommended Posts

I have used combo boxes for years in Access and the 'select' element on an html form is similar.   All of the tutorials on w3 show how to fill the 'options' with literal values, but I would like to have the options be filled from a table in a database so the user can select one.  I know this is probably a cross-topic item and I have an idea of how to go about it using javascript, php and sql, but I thought I'd ask if anyone knew of a procedure which is already created for this.   In Access you just enter the row source for the combo box and the options are there - is there any kind of construct to do that for a 'select' element in html?   Thanks

 

Link to comment
Share on other sites

You have to use a programming language to loop through database records and generate options. HTML is completely unaware of what happens on the server.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...