473,766 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I get the dropdown's selected value

Hello
Can you help me.
By ASP
How can I get the dropdown(contro l'name)'s selected value?
What is it's property'name?

Jul 19 '05
24 77392


You have to submit ur form under which your drop down element exist.
After submitting you can get it's value like this
to display
Response.Write request("NameOf control")
to assign to some variable
ur variable request("NameOf control")

Or you can even catch it with out submiting through java script.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #21

Guinness Mann no body is perfect is this IT world.Can u think bill gates
knows how to programme in Java . Absolutely not. So pls encourage other
fellow developers.
thanx
peace
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #22
janice li wrote:
I need help to display the selected value from database in the
dropdown list. Following is my code...but there are some error:


We are not looking over your shoulder at your screen. You need to tell us
what the errors are.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #23
while NOT rs.EOF
If rs("Description ") = rsStatus("sc_st atus") Then
strSelect = "SELECTED"
else
strSelect = ""
end if

Response.Write ("<option value = '" & rs("Description ") & "' " &
strSelect & ">")
Response.Write (rs("Descriptio n"))
Response.Write ("</option>")

rsStatus.MoveNe xt
wend

"janice li" <j_*****@hotmai l.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..


I need help to display the selected value from database in the dropdown
list. Following is my code...but there are some error:

while NOT rs.EOF
Response.Write ("<option value = '" & rs("Description ") & "'")
Response.Write (">")
If rs("Description ") = rsStatus("sc_st atus") Then
Response.Write ("<Option value = '" & rsStatus("sc_st atus") & "'
SELECTED>")
Else
Response.Write (rs("Descriptio n"))
Response.Write ("</option>")
rsStatus.MoveNe xt
end if
wend

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #24


Thanks a lot....

I got it already..

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2149
by: Kannan.M.R | last post by:
Hi, I have a problem in assigning the selected value in the dropdown to a hidden control. It goes like this. I have a repeater control. In the repeater control’s item template, I have a hidden control and a placeholder control. I must generate the required number of dropdowns and the buttons dynamically based on a field value in my dataset. So I do the same in my code behind and add the generated controls to the place holder in the...
0
1552
by: Kannan.M.R | last post by:
hi, I have a repeater. In the item template of the repeater i have a place holder control. In the item databound event of the repeater, In a for loop, i create dropdowns and buttons in a loop and add the same to the placeholder. I bind a datatable as the datasource for the dropdown. The requirement is to get the selected value in the dropdown. The problem i have here is, Since i must be able to repaint the whole control on the page, i must...
1
392
by: Andy Sutorius | last post by:
Hi, I have 4 panels, each panel has a dropdown and a "next" button. I would like to get the selected value of the dropdown after the next button is clicked. I thought I could use the following (ddlChooseEmail.SelectedValue) to grab the value but it does not work. Is there something special about panels that I need to do in order to get the selected value of the dropdown? Thanks,
6
5398
by: Jenna Alten | last post by:
I have a datagrid with a template column that contains a dropdown list. I currently fill and display the dropdown list on the page load. This is working correctly. I am NOT using an Edit Column. I am receiving errors when trying to set the selected value of the dropdown within the ItemDataBound() subroutine. Below is the code I am using. I hope someone can tell me if this is possible. '''HTML''' <asp:datagrid id="dgAssignments"...
1
10399
by: Ben | last post by:
I have a formview with a few dropdownlists (software version, database version, etc). When a software version is selected, the database version dropdownlist updates itself accordingly. When in edit mode, everything works fine - the selected value in each list defaults to the value from the database record (selectedvalue=bind...). However, in insert mode (insertitem), it is not working. I pass in a value on the query string that I would...
1
14314
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. Both the grid and the dropdown box are retrieving and displaying data fine, I just cant bind the two together. I followed the instructions in the help document called 'Walkthrough: Displaying a Drop-Down List While Editing in the GridView Web...
4
2515
by: Ronny Mandal | last post by:
Hi! I have an .aspx with some controls that are created dynamically. The items are populated into the box by setting the DataSource-property to a list. In addition I specify the text and value with DataTextField and DataValueField; this works as expected. However, my problems arises when I want to read the selected value (i.e. after a postback caused by a change in the DropDown), the selected item is always the first item in the...
17
5477
by: jerrydigital | last post by:
Hello, I have an edit user page that allows the user to view their user information and make changes if possible. I have a simple html login page that directs to an asp page called edituser.asp when they login. Here is the edituser.asp code I have <%@ Language=VBScript %> <% Option Explicit %> <!--#include virtual="/adovbs.inc"--> <html> <body> <%
1
6299
by: techbytes | last post by:
hi, I have 2 dropdowns ,after populating the dropdown with selected values,the page is refreshed. so the selected value in the dropdown is not retained in the dropdown list. I want to retain the selected value in the dropdown after the form is submitted.
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9837
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
5279
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...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.