Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box value to update table (2003)

    Hello,

    I have an ASP page going that acts as a conference room scheduler. I have been asked to add a drop down with the differect conference rooms. I am unable to get the drop down to send info to update my table. The text boxes all work fine and update their fields but the combo box (dropdown) does not. Below is the code, what am I doing wrong here?

    <SELECT NAME="CONF_ROOM">
    <OPTION VALUE="<% =Server.HTMLEncode(sConf_Room) %>">Large Conference Room</OPTION>
    <OPTION VALUE="<% =Server.HTMLEncode(sConf_Room) %>">Small Conference Room</OPTION>
    </SELECT>

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Combo Box value to update table (2003)

    Does this correctly display the values you want?

    It looks like it should.

    Can you post the code that takes the values from the form and uses them to update the table. The problem is probably somewhere there.
    Regards
    John



  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Combo Box value to update table (2003)

    Some further thoughts on this.

    When you put a <Select> item in an ASP page, you can fill it in one of two ways. Either you hard code in some values, or you use ASP to dynamically extact them from the database. Either will work, but the dynamic method is better because it won't need recoding if extra data is added to the database.

    It is not clear which way you are doing it, because you have hard-coded the names of the rooms, but have written asp code to put in the Conf_room value whcih I imagine is a key field.

    My suspicion is that this asp code is not working, so the hidden values don't contain what you actually need. So , if you only have two rooms and it is not going to change you could remove this ASP code "<% =Server.HTMLEncode(sConf_Room) %>"> and replace it with the actual values .

    To fill a list dynamically, you need to create another recordset based on the table that contains the data you want to put into the dropdown list (In your case the Conference_rooms table , whatever you call it) then write looping code to work through each record in this recordset and create an option for the <Select> for each of the records.

    Post back if you want to try the second, but need a hand.

    John
    Regards
    John



  4. #4
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box value to update table (2003)

    It's funny how I sometimes overlook the obvious. Thanks for pointing out the simple way to do this. It works just fine with the values included.

Posting Permissions

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