.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old October 20th, 2000, 03:34 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Selecting Values in a Drop Down Box - DATABASE

<i><b>Originally posted by : Bipasha (bipasha@hotmail.com)</b></i><br />This is the code I have, to display a drop down box with values from 1 to 100<br /><br /><select name="reports"><br /> <option selected value="1">1</option><br /> <% for i = 2 to 100 %><br /> <option value="<%=i%>"><%=i%></option><br /> <% next<br /> i = i + 1<br /> %><br /><br />Suppose I insert (value=45) for reports into a database. The next time I view this drop down box for that particular report....I want 45 to be selected (highlighted) instead of 1 (which is the default)<br /><br />I tried doing this:<br />------------------<br /><select name="reports"><br /> <% for i = 1 to 100 <br /> If Session("val") = i then %><br /> <option selected value="<%=Session<br /> ("val")%>"><%=Session("val")%><br /> </option><br /> <% Else %><br /> <option value="<%=i%>"><%=i%</option><br /> <% End If<br /> next<br /> i = i + 1<br /> %><br /><br />But this doesnt seem to be working. Can somebody please help me with this problem?? Thank U in advance.<br /><br />

Reply With Quote
  #2  
Old November 3rd, 2000, 06:58 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,578 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Troels Majlandt (troels@majlandt.dk)</b></i><br />This should do the trick.<br /><br /><br /> <td width="20%" valign="top" align="left" bgcolor="#DDEEFF"><font color="#000080"><b>Vision</b></font></td><br /> <td width="80%" valign="top" align="left" bgcolor="#FFFFCC" colspan="3"><nobr><select NAME="vision" SIZE="1" style="font-family: Verdana; font-size: 8 pt; color: #000080"><br /> <%DO WHILE NOT rs3.EOF%><br /> <option value="<%=rs3("Visions_ID")%>" <%if rs3("Visions_ID") = rs("Visions_ID") Then response.write " selected " end if%>><%=rs3("Vision")%></option><br /> <%rs3.MoveNext<br /> LOOP<br /> RS3.Close%><br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > Selecting Values in a Drop Down Box - DATABASE


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway