473,473 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Create 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 2707
Paul wrote on 08 jul 2008 in microsoft.public.inetserver.asp.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
"txtNewListValue" 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.Form("txtNewListValue")) 0 then
'use ADO to insert the new value into the database
dropdownvalue=Request.Form("txtNewListValue")
else
dropdownvalue=Request.Form("dropdownelement")
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.localwrote in message
news:DD**********************************@microsof t.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
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...
0
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...
0
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...
1
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...
1
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...
1
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...
2
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"...
1
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
by: gurukishore | last post by:
i want editable dropdown list in c#.net 2003.. any body help me.. its urgent guru
0
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...
0
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,...
1
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...
0
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,...
1
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...
0
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...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.