Dynamic Web Page, Generate <select> Dynamically |
Dynamic Web Page, Generate <select> Dynamically |
joehesse |
Aug 28 2018, 11:27 AM
Post
#1
|
Group: Members Posts: 7 Joined: 5-July 18 Member No.: 26,667 |
I have an html page, generated with php and mysql, that has an html table of real estate properties. The table has a hidden column. The cells in the hidden column contain folder paths. Each folder contains pdf, jpeg, and text files relvant to the real estate property in the row.
How do I do: When a row is selected by the user, I want a <select> tag to appear listing the file names in the folder. I know how to write a php function that takes as input the folder name and generates the html <select> of files in the folder. I don't know how to make the <select> appear next to the table. How do I do: When the user selects an item (file) from the <select> tag, the file should open in a different browser tab. Any pointers as to what I should look at would be much appreciated. Thank you, Joe |
Christian J |
Aug 28 2018, 02:53 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
How do I do: When a row is selected by the user I want a <select> tag to appear If it's just three options (PDF, JPEG and text) a SELECT menu is overkill. Three ordinary links would be more robust, and the user wouldn't have to open a SELECT menu. QUOTE I don't know how to make the <select> appear next to the table. You could use javascript and CSS to make the list (or SELECT) for the selected row appear in a cell in that row. You could also make it appear close to the whole table with CSS, if the exact position relative to the selected row is not important. Using CSS, the exact position may change depending on users' browsers or viewport sizes (e.g., on a smartphone maybe above or below the table works better, while a desktop browser might display it to the left or right). QUOTE How do I do: When the user selects an item (file) from the <select> tag, the file should open in a different browser tab. This can be done with javascript, but that adds more usability issues, see http://jkorpela.fi/forms/navmenu.html With ordinary links you might use the TARGET="_blank" attribute, javascript won't be necessary. |
Lo-Fi Version | Time is now: 26th April 2024 - 09:02 AM |