The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Dynamic Web Page, Generate <select> Dynamically
joehesse
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 28 2018, 02:53 PM
Post #2


.
********

Group: WDG Moderators
Posts: 7,894
Joined: 10-August 06
Member No.: 7



QUOTE(joehesse @ Aug 28 2018, 06:27 PM) *

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.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th September 2018 - 04:23 PM