Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datasrc and datafld on <select> tag

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
I'm trying to populate a combo box with values from a field that I have in an access database.

This tag appears like it would help me do that, although I'm not sure how it's used, (syntax etc)

can anyone show me where I can find an example of how you would use these?

How much more water would there be in the ocean if it weren't for sponges?
 
Hi scroce,
Try this:
Take the first of this example and save it as a .txt file called: StockData.txt

Symbol,Acquired,Shares,Quote,AssetValue:INT,Chart
IBM,1995,200,137.875,27575,<IMG SRC=StockData/IBM.gif>
MSFT,1995,500,97.125,48562,<IMG SRC=StockData/MSFT.gif>
GM,1996,100,54.25,5425,<IMG SRC=StockData/GM.gif>
T,1995,400,33.50,13400,<IMG SRC=StockData/T.gif>
INTC,1996,300,131.00,39300,<IMG SRC=StockData/INTC.gif>
----------------------------------------------------------
Now, take this second part and save it as DataCaller.html:

<HTML>
<HEAD>
<TITLE>Stock Portfolio</TITLE>

<SCRIPT>
function asset_sort()
{
TDC1.SortAscending=false;
TDC1.SortColumn=&quot;AssetValue&quot;;
TDC1.Reset();
}

function symbol_sort()
{
TDC1.SortAscending=true;
TDC1.SortColumn=&quot;Symbol&quot;;
TDC1.Reset();
}

function year_filter()
{
TDC1.FilterColumn=&quot;Acquired&quot;;
TDC1.FilterValue=newyear.value;
TDC1.FilterCriterion=&quot;=&quot;;
TDC1.Reset();
}

</SCRIPT>

</HEAD>

<BODY>

<OBJECT ID=TDC1 CLASSID=&quot;clsid:333C7BC4-460F-11D0-BC04-0080C7055A83&quot; WIDTH=0 HEIGHT=0>
<PARAM NAME=DataURL Value=&quot;StockData.txt&quot;>
<PARAM NAME=TextQualifier Value=&quot;,&quot;>
<PARAM NAME=UseHeader Value=True>
</OBJECT>

<P>

Sort by: <INPUT TYPE=BUTTON VALUE=&quot;Symbol&quot; ONCLICK=symbol_sort()>
<INPUT TYPE=BUTTON VALUE=&quot;Asset Value&quot; ONCLICK=asset_sort()>
<P>
<LABEL FOR=newyear>Enter Year:</LABEL><INPUT TYPE=TEXT ID=newyear>
<INPUT TYPE=BUTTON VALUE=&quot;Apply Year Filter&quot; ONCLICK=year_filter()>
<P>

<TABLE ID=Table1 BORDER DATASRC=#TDC1>
<TBODY>
<TR>
<TD ROWSPAN=2><DIV DATAFLD=Acquired></DIV></TD>
<TD><SPAN DATAFLD=Symbol></SPAN></TD>
<TD ROWSPAN=2><DIV DATAFLD=Chart DATAFORMATAS=HTML></SPAN></TD>
</TR>
<TR>
<TD><SPAN DATAFLD=Shares></SPAN>  shares @
<SPAN DATAFLD=Quote></SPAN> = $<SPAN DATAFLD=AssetValue></SPAN></TD>
</TR>
</TBODY>
</TABLE>
</BODY>
</HTML>
-----------------------------------------------------------
That ought to give you all the starting info you need.
<code is not mine...think I got it from a MS tutorial or something....>
The heart of the action is the OBJECT segment of the code,
and the TABLE setup.
Enjoy!
- Omicron -
 
thanks omicron. tek-tips comes thru again. How much more water would there be in the ocean if it weren't for sponges?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top