Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Problem with Combo box
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem with Combo box

 Post Reply Post Reply
Author
stevem2003 View Drop Down
Newbie
Newbie
Avatar

Joined: 07 November 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevem2003 Quote  Post ReplyReply Direct Link To This Post Topic: Problem with Combo box
    Posted: 10 November 2003 at 6:56am

Hi,

I have several combo/ pull down boxes in my forms, but when I use one of these in an amend script, the combo box only displays the first item in the combo, not the value recorded in the database.

Anyone know how to resolve this?

I have the following code in the combo box:-

<select name="timetaken" class="midgreen" value="<%=rs("timetaken")%>">
          <option value="5">5</option>
          <option value="10">10</option>
          <option value="15">15</option>
          <option value="20">20</option>
          <option value="25">25</option>
          <option value="30">30</option>
   <option value="450">450</option>
   <option value="2250">2250</option>
        </select>

TIA

Steve

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2003 at 7:42am
Try
<select name="timetaken" class="midgreen">
<option value="5" <% if Clng(rs("timetaken"))=5 then Response.Write " selected" end if%>>5</option>
<option value="10" <% if Clng(rs("timetaken"))=10 then Response.Write " selected" end if%>>15</option>
<option value="20" <% if Clng(rs("timetaken"))=20 then Response.Write " selected" end if%>>20</option>
<option value="25" <% if Clng(rs("timetaken"))=25 then Response.Write " selected" end if%>>25</option>
<option value="30" <% if Clng(rs("timetaken"))=30 then Response.Write " selected" end if%>>30</option>
<option value="450" <% if Clng(rs("timetaken"))=450 then Response.Write " selected" end if%>>5</option>
<option value="2250" <% if Clng(rs("timetaken"))=2250 then Response.Write " selected" end if%>>2250</option>
</select>
Back to Top
stevem2003 View Drop Down
Newbie
Newbie
Avatar

Joined: 07 November 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevem2003 Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2003 at 7:55am

Many Thanks

Works a treatSmile

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.