Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Edit a dropdown menu


Message #1 by Natividad Castro <natcastollo@y...> on Fri, 8 Feb 2002 11:14:52 -0800 (PST)
Hi to all,

does anybody know how to let the users to edit a drop

down menu which is populate from a table? In this

project I'm spliting each field into drop down menus.

For each word I will create one drop down menu. Users

will be able to select a word in each drop down menu

until they complete a name and then they will submit

it to a database, this part I got it, my problem is

that I can't type anything in the drop down menu.

any idea. How I can let users to type in case that

they need to change a name?

Here is the code that I got working properly, I just

need to be able to type over any name in the drop down

menu



Thanks in advanced

Nato.. 



Set Conn2 = Server.createObject("ADODB.Connection")

Conn2.Open("DSN=test91")



Set RS2 = Conn2.Execute ("SELECT ID, NAME FROM test90

WHERE LOCATOR2 is null")



Dim strArrWords2

Dim NumberOfWords2

Dim idNumber2



if RS2.EOF then

   response.write "you're done with LOCATOR2.."

   RS2.close

   Set RS2 = nothing

   Conn2.close

Else

   idNumber2 = rs2("ID")

   'strArrWords2 = split(rs2("NAME")," ", -1, 1)

    

   

   strArrWords2 = split(rs2("Name"))

   NumberOfWords2 = UBound(strArrWords2) + 1

'strArrWords2 = Replace(rs2("Name"), "&","AND")



'Create number of drop down menus depending on the

number of words that the field NAME contains

   For x = 1 to NumberOfWords2

      response.write "<select name=locator2>"

      For i = lbound(strArrWords2) to

ubound(strArrWords2)

         Response.Write UCase("<option>" &

strArrWords2(i) & "</option>")

      Next

      response.write "<OPTION>&nbsp;</OPTION>"

      Response.Write "</select>"

   Next



%>

  

<input type="hidden" name="idNumber2" value="

<%

=idNumber2

%>"



<%

RS2.close

Set RS2 = nothing

Conn2.close

end if

%>

  <BR><br><br>

  <input type="submit" value="Submit">

  

  </form>



__________________________________________________

Do You Yahoo!?

Send FREE Valentine eCards with Yahoo! Greetings!

http://greetings.yahoo.com

Message #2 by "Ken Schaefer" <ken@a...> on Mon, 11 Feb 2002 18:00:03 +1100
I don't think you can do this with a standard HTML <select> form element.

You might want to ask on a client-side scripting list though.



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Natividad Castro" <natcastollo@y...>

Subject: [access_asp] Edit a dropdown menu





: Hi to all,

: does anybody know how to let the users to edit a drop

: down menu which is populate from a table? In this

: project I'm spliting each field into drop down menus.

: For each word I will create one drop down menu. Users

: will be able to select a word in each drop down menu

: until they complete a name and then they will submit

: it to a database, this part I got it, my problem is

: that I can't type anything in the drop down menu.

: any idea. How I can let users to type in case that

: they need to change a name?

: Here is the code that I got working properly, I just

: need to be able to type over any name in the drop down

: menu

: 

: Thanks in advanced

: Nato.. 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  Return to Index