473,881 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

selection of value in listbox

samycbe
83 New Member
I am displaying i number of rows with 3 columns (1 sno 2 description 3 category) . the category is in listbox. and i am generating new row for the entry after display. S.No will be generated. Description will be typed by the user. in category list box i am displaying the existing categories. and i want to make last selected category (in row i) should be selected here. how to do it.

The following code is not working for me...

<option <% if rs2("category") = Request.Form("C boCategory"&i) then %> selected <%end if %> value ="<%=rs2("categ ory")%>"> <%=rs2("categor y")%></option>

please help me....

samy
Aug 7 '07 #1
2 1409
shweta123
692 Recognized Expert Contributor
Hi,

Are you getting last selected value by comparing it with database value?
What Request.Form("C boCategory"&i) is for?




I am displaying i number of rows with 3 columns (1 sno 2 description 3 category) . the category is in listbox. and i am generating new row for the entry after display. S.No will be generated. Description will be typed by the user. in category list box i am displaying the existing categories. and i want to make last selected category (in row i) should be selected here. how to do it.

The following code is not working for me...

<option <% if rs2("category") = Request.Form("C boCategory"&i) then %> selected <%end if %> value ="<%=rs2("categ ory")%>"> <%=rs2("categor y")%></option>

please help me....

samy
Aug 7 '07 #2
samycbe
83 New Member
i am displaying all the values in combo box from database and trying to check the last listed rows combo box value. But it is not working
Aug 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1749
by: middletree | last post by:
We have all seen those web pages which feature a multiple <select> box on the left, and an empty one on the right, and the user selects one or several options from the left box, clicks a button, and those selections appear in the right box. Although I have seen these, I have never tried coding them before, until now. I imagine that there is some client-side code involved, but because my code will use ASP to do some stuff with the...
18
5732
by: booner | last post by:
I have a form that when it loads I would like to highlight the values (from a DB) that have been selected in a multiple selection list (<select multiple="true">. function onLoad() { document.forms.elements.value = "<value from DB>"; }
8
25506
by: Peter Bailey | last post by:
I have a form that allows the user to selct items from a listbox and combo box. how do I reset them ready for the next set of entries. I thought I would have a clear button. regards in advance. Peter
2
6813
by: (Pete Cresswell) | last post by:
Seems like I've been here before, but can't find anyting in Google. I've got two list boxes on a form. Seems to me like the inactive ListBox's selection rectangle should be something like gray...otherwise, the user sees two ListBoxes, both with black selection rectangles - and the user does not visually know which one he is "in". This becomes relevant if we have a keyboard-type user - they want to hit "Enter" and have something...
2
2586
by: DK | last post by:
Hello everybody ! I need little help from Your side. I have form called Form2, and ListBox called List 20. Property of List 20 allow multiple selection. Also I have query called Distribution as mail merge source.I need to control query Distribution to send letters to people selected in List 20. When I use List20 control without multiple selection everything is OK. Single letter is printed. Thank You in advance for Your help
5
3538
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all selected items of that listbox and display it. can anyone help? Thanks
3
2431
by: Chris Kettenbach | last post by:
Hello all, Quick question. I have a listbox that is populated by items from a database. When the user select something from the list, I want to populate another listbox based on the selection in the first. Example lstCompany contains a list of company names with the primary key field hidden. After user selects a company, I want to pass that primary key back to a stored procedure and the 2nd listbox lstEmployees then be populated with...
5
2322
by: Dave H | last post by:
I have an asp:listbox, allowing multiple selections, is there a quick check to see if there's more than one selected, or do I need to go through the whole list? Thanks, Dave
10
3312
by: Adam Clauss | last post by:
I have a page containing a list box. This list may contain duplicate items - in which the ORDER is important. ex: a b b a is significant as compared to: b
3
2399
by: Jay Ruyle | last post by:
I'm trying to figure out a way to list several items in a listbox and let the user select any number of items in the listbox. I have tried to code in the items as bitwise items but all it stores in the database is the top item in the listbox. How can I get the listbox to add all the bit values to be stored and also come out properly when viewed later? Example:
0
9776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10724
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10825
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10403
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9556
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7113
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4598
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.