473,837 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

editable dropdown/list field

Hi all,

I have a page that has a form on it which has a dropdown list on it. It
connect to an sql database and populate the list. What I would like to do is
make the list editable so that if the data returned doesnt contain what I
want, I can type in the data I require which will then be updated to the
database when the form is posted.

Hope I've made sense, you may be able to tell I'm a bit of a newbie!

Any help would be really appreciated!

Thanks in advance

Jul 8 '08 #1
4 2729
Paul wrote on 08 jul 2008 in microsoft.publi c.inetserver.as p.general:
Hi all,

I have a page that has a form on it which has a dropdown list on it.
It connect to an sql database and populate the list. What I would like
to do is make the list editable so that if the data returned doesnt
contain what I want, I can type in the data I require which will then
be updated to the database when the form is posted.

Hope I've made sense, you may be able to tell I'm a bit of a newbie!
ASP has no dropdown lists, you will need to do this clientside.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 8 '08 #2
Paul wrote:
Hi all,

I have a page that has a form on it which has a dropdown list on it.
It connect to an sql database and populate the list. What I would
like to do is make the list editable so that if the data returned
doesnt contain what I want, I can type in the data I require which
will then be updated to the database when the form is posted.
Your question does not make clear whether you wish to use the new value in
subsequent dropdown lists, or whether you just want to process the value but
leave the dropdown list unaltered. I will assume that you want the value to
appear in subsequent dropdown lists.
Hope I've made sense, you may be able to tell I'm a bit of a newbie!

Any help would be really appreciated!
You will need to use an additional input element whose name is set to
"txtNewListValu e" for example.

When the form is submitted, the server-side code asp page that is requested
needs to check to see if any text was entered in the element, like this:

<%
....
'Do this before opening the recordset from which the
'dropdown values are generated
dim dropdownvalue
if len(Request.For m("txtNewListVa lue")) 0 then
'use ADO to insert the new value into the database
dropdownvalue=R equest.Form("tx tNewListValue")
else
dropdownvalue=R equest.Form("dr opdownelement")
end if
....
open the recordset from which the
'dropdown list is populated

%.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 8 '08 #3
What you are looking for is what Windows calls a "combo-box". And it's a
quite common feature in Windows-based forms.

But HTML doesn't support one. At least not directly.

It's not too hard to create the *appearance* of one using JavaScript, but if
you intend it to work with all browsers you have to be pretty careful in
constructing it.

You might do a Google search for "html combo box" or "javascript combo box"
and see if you get any hits.

As Bob Barrows showed, it's pretty easy to get the same functionality by
using both a <SELECTand an <INPUTfield, but yes, if you can do it
"prettier" using JS and CSS it can have a nice effect.

Jul 8 '08 #4
Many thanks for your assistance.

After everything, I cheated a bit and just made a link to another form which
allowed me to do what i wanted!

thanks again
"Paul" <Pa**@here.loca lwrote in message
news:DD******** *************** ***********@mic rosoft.com...
Hi all,

I have a page that has a form on it which has a dropdown list on it. It
connect to an sql database and populate the list. What I would like to do
is make the list editable so that if the data returned doesnt contain what
I want, I can type in the data I require which will then be updated to the
database when the form is posted.

Hope I've made sense, you may be able to tell I'm a bit of a newbie!

Any help would be really appreciated!

Thanks in advance
Jul 11 '08 #5

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

Similar topics

0
4053
by: Faith | last post by:
I found code on www.codeproject.com. Here is a sample it is called DataGridColumnDropDown. I modified it to use the text box when I wanted it to depended on a certain search criteria. Public Class ExtendedSearchFieldValueColumnStyle Inherits DataGridTextBoxColumn Public WithEvents ColumnComboBox As ComboBox Public WithEvents ColumnTextBox As TextBox
0
1636
by: Philip Townsend | last post by:
I have a datagrid that contains a dropdown list that is part of an EditItemTemplate. I need to run some code when the dropdown list builds in order to preselect an item in the list. Preselecting the item is not the problem. The problem is that the dropdown object is not instantiated at the point at which the Edit button is clicked, or at any other obvious step in the process. In other words, when a user clicks the Edit (EditCommand)...
0
1759
by: george d lake | last post by:
Hi, Is there a way to have a "Auto Complete" textbox or a "editable" dropdown? Here is my problem. I have a screen that need to have a list of 800+ employees. To be a dropdown, that could be a lot of scrolling. and to enter the name in a textbox leaves too many possible typos. So, is there a control that will do a auto complete in the textbox as I type the name or have a combo box that I could type and auto complete like in VB?
1
2544
by: Kenneth Keeley | last post by:
Hi, Is there a way to create a editable drop down list. This would be some sort of text box with a drop down list attached. My idea is to have a text box that has a dropdown list that has some default values in it and if the value the user wants is not in there then they can type the one they want into the edit box. Thanks
1
1747
by: Philip Townsend | last post by:
I have a datagrid that contains a dropdown list that is part of an EditItemTemplate. I need to run some code when the dropdown list builds in order to preselect an item in the list. Preselecting the item is not the problem. The problem is that the dropdown object is not instantiated at the point at which the Edit button is clicked, or at any other obvious step in the process. In other words, when a user clicks the Edit (EditCommand)...
1
1835
by: Larry Rekow | last post by:
Using: MS SQL, VS.Net 2003, VB.Net Each night our SQL db imports two text file reports into two tables: Table 1 has info on various shipments (shipment number, date, destination, etc.) Table 2 has dates and shipping events for the various shipping numbers. (only 3 columns for date, shipment number and shipping event) I've creates an aspx page where the customer can select shipment by either a date range or by a word in one of the...
2
5042
by: zambizzi | last post by:
....I can't seem to get my hands on a control I'm loading in an editable datagrid. Here's my datagrid control: <asp:datagrid id="GLRulesGrid" runat="server" autogeneratecolumns="False" oneditcommand="GLRulesGrid_Edit"
1
1239
by: avijit_gs | last post by:
Could any one tell me that how can I update an editable grid with dropdown list as template field for the dynamically created collumns.
3
1908
by: gurukishore | last post by:
i want editable dropdown list in c#.net 2003.. any body help me.. its urgent guru
0
9694
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
10901
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...
1
10639
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
10286
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
9419
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...
1
7824
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5680
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
5863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3128
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.