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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Form Buttons

Status
Not open for further replies.

JohannIcon

Programmer
Sep 3, 2002
440
MT
I have an asp that displays a table, with the current Year and a list of the months, and when the user clicks on the month he wants, he is taken to a link displaying another asp.

I also have an Access table, with this relevant information. Now what I want to do is display a list of DISTINCT years there is in the database, which I am already doing, and then when the user clicks on a particular year, the HTML table is populated with the YEAR the user chooses and the relevant links to that year which I bring from the database.

How can I create these (YEAR) buttons dynamically? I was thinking of doing something like this:-

<%
rsYearStats.movefirst
do
%>
<form name=&quot;Year&quot; method=&quot;post&quot; action=&quot;stats.asp&quot;>
<center>
<%
Response.Write &quot; <input name=Year type=submit id=Year class=menu value=&quot; rsYearStats.Fields(&quot;Year&quot;)&quot;>&quot;
Response.Write(&quot; &quot;)
rsYearStats.MoveNext
if rsYearStats.eof then
exit do
End If
loop until rsYearStats.eof
%>
</center>
</form>

where stats.asp is the current asp page. However I have some errors in the syntax. Can you please help me out here?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top