Htmldropdown in Htmltable

Jul 18, 2012 at 3:24 PM

As an example, I have a table and one column needs to be a HTMLdropdown(select tag).  Any ideas how to do this? In the initial load of the page, the column needs to display the value of the HTMLTable source, but when user click on the HTMLDropdown, it needs to show values from another source (a child table).

Main table: (source of HTMLtable)

Select fruitname, color from fruits into cursor tcursor readwrite

Child table: (source of HTMLDropdown)

Select color from attributes into cursor curAttributes readwrite

Again the question is, how would I construct my HTMLDropdown so it would display values from one of the HTMLtable source column.  I've tried the code below but only displaying the first value on the dropdown for all the rows being displayed.

oSession.VALUE("selectedcolor", tcursor.color)
curColorSelect = oHTML.HTMLdropdown('curAttributes.color' ,'curAttributes.color','selectedcolor','Select a color',oSession.VALUE("selectedcolor"),.F.)

In my HTML:




<select name="selectedcolor" id="selectedcolor">