birdycarolyn
Technical User
Hello Experts,
I'm fairly new to ASP and VBScript and would like to know if what I want to do is possible, and the best way to do it.
I present a form to the user, where they have 4 dropdown boxes to choose information from: A segment, Month, Day and Hour. The 'segment' dropdown list items are hardcoded, but the Month, day and hour dropdown boxes are populated using a variation of the following code which ensures that the the current month, day and hour are highlighted.
<code>
<SELECT NAME="SMAMonth">
<%Dim M
for M = 1 to 12
Response.Write(vbNewLine)
if M = Month(date) then
Response.Write("<OPTION selected value=" & M & ">" &
M & "</OPTION>"
else
Response.Write("<OPTION value=" & M & ">" & M
& "</OPTION>"
end if
next
%>
</SELECT>
</code>
When the user Submits the form, a table of results is displayed BELOW the form. However, when they press Submit, I use "#include file" to call numerous ASP files to create the web page, and in the process I refresh the form so that the options they just selected get refreshed according to the script above.
Once the table is displayed, I would like the user to be able to still use the form and make selections, but I would like their selections to be retained by the dropdown boxes. So, should I use variables somehow to save these results? Or, is there a way, when they press Submit, that I can just insert the table under the form versus refreshing everything? I hope I have made myself clear and appreciate any help.
Carolyn
I'm fairly new to ASP and VBScript and would like to know if what I want to do is possible, and the best way to do it.
I present a form to the user, where they have 4 dropdown boxes to choose information from: A segment, Month, Day and Hour. The 'segment' dropdown list items are hardcoded, but the Month, day and hour dropdown boxes are populated using a variation of the following code which ensures that the the current month, day and hour are highlighted.
<code>
<SELECT NAME="SMAMonth">
<%Dim M
for M = 1 to 12
Response.Write(vbNewLine)
if M = Month(date) then
Response.Write("<OPTION selected value=" & M & ">" &
M & "</OPTION>"
else
Response.Write("<OPTION value=" & M & ">" & M
& "</OPTION>"
end if
next
%>
</SELECT>
</code>
When the user Submits the form, a table of results is displayed BELOW the form. However, when they press Submit, I use "#include file" to call numerous ASP files to create the web page, and in the process I refresh the form so that the options they just selected get refreshed according to the script above.
Once the table is displayed, I would like the user to be able to still use the form and make selections, but I would like their selections to be retained by the dropdown boxes. So, should I use variables somehow to save these results? Or, is there a way, when they press Submit, that I can just insert the table under the form versus refreshing everything? I hope I have made myself clear and appreciate any help.
Carolyn