Results 1 to 7 of 7

Thread: Combobox in ASP / HTML ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Québec, Canada
    Posts
    212

    Cool Combobox in ASP / HTML ?

    Hi everyone !

    1) I'm currently developping an ASP application using ADO. I want to know if it is possible to transfer the content of a particular field of all records in a table to a listbox ? If so, how ? I tried many things, but keep getting errors !

    2) Is it possbile to transfer an array from the server to the client ?
    If so, how ?

    3) Is there anything like a combobox in HTML i could use (like in VB) ?

    I'm rather new to ASP and HTML, but I guess you already figured it out ! :P

    Thanks in advance !
    Regards,

    El-Nino

  2. #2
    Hyperactive Member Bloged's Avatar
    Join Date
    May 2001
    Location
    Rotterdam, The Netherlands
    Posts
    330

    HTML

    I know that there is a combobox available in HTML

    When you make a Form (I think you know how)

    You can add a combo by using:
    <SELECT name="test">
    <OPTION>OptionA</OPTION>
    <OPTION>OptionB</OPTION>
    <OPTION>OptionC</OPTION>
    <OPTION>OptionD</OPTION>
    </SELECT>

    But how to import options from a table I don't know.

    I hope I helped...

    Grtz,

    Bloged

  3. #3
    Hyperactive Member Bloged's Avatar
    Join Date
    May 2001
    Location
    Rotterdam, The Netherlands
    Posts
    330

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    1) Goto http://www.learnasp.com. They have a couple articles on this.

    2) Do you mean server as in from an ASP page to VbScript or Javascript on the client?
    If so, No.

    3) See above replies.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5
    Behemoth
    Guest
    I'm pretty new to ASP too, but I know you can mix-and-match tags, so...
    Code:
    ' blah blah, open database connection, get stuff out, open HTML and BODY tags in page, when you eventually get to the box, its something like this:
    'while within HTML tag (ASP tag closed)
    
    <SELECT name="test">
    <%
    for loop = 0 to wherever you want
    %>
    <option><%=loop%><option>
    <%
    next
    %>
    </select>
    I know it looks a bit clumsy, I'm not able to test it, but I hope you get the gist of what I'm trying to say.

    BTW the bold bit <%=loop%> means exactly the same as
    <%
    response.write loop
    %>


  6. #6
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    You can sort of transfer an array between client and server:

    You must use Response.Write to create the client side array code and populate it in the same manner.

    You can not change it on the client and see those changes on the server unless you post the array back to the server in an HTML form tag or some other persistence method.

    I use that all the time to create dynamic list boxes that change their content based on the selection in another list box.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2000
    Location
    Québec, Canada
    Posts
    212
    Thanks for all the info guys !
    Especially Behemoth, I modified your code to suit my needs, thanks dude !
    I finally managed to get things up, Sort'of;
    I Used a textbox refreshing on every <Select> which refreshes the textbox... well kinda dependent on each other ! Does the trick ! =)

    Regards,

    El-Nino

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width