Jump to content
Gilbert

Use database table to fill select element on a form

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

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...