Edit a drop down box in asp

T

Terren

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
 
C

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
 
T

Terren

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.
 
C

CJM

Terren said:
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
 
D

Danny@Kendal

Terren said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,198
Latest member
JaimieWan8

Latest Threads

Top