473,473 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Edit a drop down box in asp

I need to be able to edit a drop down box is asp. On my web app I
populate a drop down box from a databse. The user can then select an
option that will then be saved to a Database for example

Mr
Mrs
Miss

but if the option is not their e.g Dr, Prof etc then I want them to be
able to enter in the drop down box and then I will save this to the
database.

I know that I will have to have a function to dynamically re-populate
the Drop down box to include this option once the new value has been
entered, so that it will be included in the POST method.

But I can't even edit the text. I have tried

<SELECT>
<OPTION selected contenteditable=true> value="Mr">Mr</OPTION>
</SELECT>

and

<SELECT contenteditable=true>
<OPTION selected> value="Mr">Mr</OPTION>
</SELECT>

but it doesn't work. I am not using the values (Mr, Miss, Mrs) they are
just example to give you an idea

Any help would be great

Sep 27 '05 #1
4 3782
CJM
In short, you can't do this.

I've seen a text box and dropdown box working together to provide this kind
of functionality, but it wasn't really that fantastic.

If you look at most sites, they just have a fixed list of half a dozen
titles and that is it. Surely this should be good enough for you??

Chris
Sep 27 '05 #2
Damn I thought that might be the case.

You see the drop down box isn't going to have"title" values. I was just
using that as an example.

My web app is going to be used to track changes made to software. The
drop down box is going to contain the version number. The user selects
the software product he/she worked on, enters the change made, bug fix
etc. and then selects what version this was for e.g 4.1242.124f. Now if
the version has been changed it won't be in the drop down box and there
is no way I can populate a drop done box with all the possible version
numbers. I am using a SELECT DISTINCT statement from a Table to get the
possible values. So once this new number has been saved it will be
added to the drop down box

I suppose I will have to do some thing like have an input box next to
the drop down box and then re-build the drop down box once the text box
has lost focus.

Sep 27 '05 #3
CJM

"Terren" <pa**@legalperfect.co.za> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Damn I thought that might be the case.

You see the drop down box isn't going to have"title" values. I was just
using that as an example.

OIC.
My web app is going to be used to track changes made to software. The
drop down box is going to contain the version number. The user selects
the software product he/she worked on, enters the change made, bug fix
etc. and then selects what version this was for e.g 4.1242.124f. Now if
the version has been changed it won't be in the drop down box and there
is no way I can populate a drop done box with all the possible version
numbers. I am using a SELECT DISTINCT statement from a Table to get the
possible values. So once this new number has been saved it will be
added to the drop down box

Ah... I see your problem.
I suppose I will have to do some thing like have an input box next to
the drop down box and then re-build the drop down box once the text box
has lost focus.


Ordinarily, I would have recommended you stick with just the dropdown, but I
think you would get some good use out of combo-box-style functionaility.

You can use client-side scripting to apply the changes to the list without
submitting the page, but that is a subject for another NG.

Chris
Sep 27 '05 #4
"Terren" <pa**@legalperfect.co.za> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I need to be able to edit a drop down box is asp. On my web app I
populate a drop down box from a databse. The user can then select an
option that will then be saved to a Database for example

Mr
Mrs
Miss

but if the option is not their e.g Dr, Prof etc then I want them to be
able to enter in the drop down box and then I will save this to the
database.


<reads rest of thread>

Include a "not listed" option in the drop-down box.
Add a separate input box for entering the new details.
Sep 27 '05 #5

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

Similar topics

0
by: San Diego Guy | last post by:
Hi all! I have Datagrid. Within that datagrid I have a drop down list that I set up some values in (a "collection") I set up an edit command column on the datagrid and wrote simple code to get...
3
by: Tim::.. | last post by:
Can someone tell me how I get the correct selected office in my drop down list when I enter edit mode. At the moment it just defaults to the office at the top of the drop down list rather than...
3
by: Tim::.. | last post by:
Can someone please tell me how I go about preselecting an item in a drop drown list when I click the Edit Command in a datagrid? I have tried the following but it doesn't work for me! I would...
1
by: ken | last post by:
Dear all, I want to add the function to gridview 1.) when edit mode, the textbox can validate before edit, e.g. if the fields is required field, user need to fill in something before edited ...
2
by: keithb | last post by:
I have dropdown list in a gridview column edit template. It works OK, except when I edit a row, the dropdown list does not initialize to the existing value that shows in the textbox that displays...
8
by: sara | last post by:
I have a table where a few of the users entered vendor names ALL IN UPPER CASE. I have created forms to edit the data, but I can't seem to allow changing JOE SMITH to Joe Smith. What to I have...
8
by: MrNobody | last post by:
If I have a control like say a drop down list and I have some kind of onSelectItem change event, is there a way to temporarily suspend the event handling (without removing the event and then...
4
by: ghjk | last post by:
I want to edit database values using my web application. So first i load data to test boxex and drop down list. But drop down list only contain one value. I want to put all posible value to that and...
5
by: agarwalsunitadhn | last post by:
hello I am using drop down in edit template instead of textbox. it runs properly bt problem is that when i click on the edit button then the selected value doesnt shown there, instead of 0th index...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.