Home | Advertising Info93 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: How to Default an HTML List Box Selected Value?
From: April
Date: 1/30/2001 9:08:24 PM
IP: 205.175.225.22



 

HELP!! I'm at wit's end with this. I have a SQL 7 back end DB with an asp front end. I'm trying to provide users with an HTML select box for editing data, but I want the box to default to whatever the current data value from the database is. The database recordset for the page is called "rsTypeData", and it contains a field called "Direct" which can only accept a value of "0" or "1". From the user's perspective, the value "0" translates to the word "Indirect" and the value "1" translates to "Direct".

Here's my code, which isn't working. The select box renders properly, giving the user a drop-down to select either "Direct" or "Indirect". The box also sends the correct value back to the database when I make a selection and submit the form. But the select box doesn't default to the correct selected item based on what the underlying data is when the page is first opened. It always just defaults to the first item on the list, "Indirect".

<SELECT dataFld=Direct dataSrc=rsTypeData id=select1 name=selNewDirect size=1>
<OPTION <% If rsTypeData.fields.getValue("Direct") = "false" Then Response.Write("selected") End If %> value=0>Indirect</OPTION>
<OPTION <% If rsTypeData.fields.getValue("Direct") = "true" Then Response.Write("selected") End If %> value=1>Direct</OPTION>
</SELECT>

What am I doing wrong?

Follow Up - Forgot to mention... - april 1/30/2001 9:11:01 PM


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com