SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jul 2003
    Location
    Abbotsford
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy DB Access Select List Issue

    I have an .asp page which accesses a database and returns a list of distinct items to a drop down list.

    The page has two forms : Form1 - containing the drop down list and Form 2 - containing the results from a different database select statement.

    A user should be able to select a drop down list item and once selected the drop down list will submit a hidden value to the second form. The second form displays results about this drop down list (maybe it is a company name, a car.....)

    The issue that I am seeing is that when the user selects the drop down list, the information in Form 2 is updated but the drop down list always remains on the same option "Select xxxxx".

    Any help on this would be appreciated as I am very new at this and at a complete loss.

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are you "submitting" the hidden value to form2? Perhaps you could issue a form reset for form 1 after you submit the value to form 2.

  3. #3
    SitePoint Zealot Drew630's Avatar
    Join Date
    Nov 2001
    Location
    Maryland
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I understand your needs on this, it seems that you want the second drop-down to be updated based on your selection in the first drop down.

    Is the hidden variable that you are passing being used in the SELECT stmt for the second box, or is the hidden variable the item that needs to be populated in the second box? Some code would be helpful as well as request's request.

    Drew
    ~Drew

    There Is No Greater Joy Than Soaring High On The Wings Of Your Dreams, Except Maybe The Joy Of Watching A Dreamer Who Has Nowhere To Land But In The Ocean Of Reality.

  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Besides the initial dbms call, are you coding this in asp or javascript? If the latter, you might find the "Cascading Selects" tutorials at my site appropriate. If not....

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  5. #5
    SitePoint Member
    Join Date
    Jul 2003
    Location
    Abbotsford
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Drop Down list

    Wow. I'm not sure, but it seems that I've given the impression I have two separate .asp pages when in fact I have only one consisting of two forms.

    I have attached the code with the latest changes. I still cannot get the drop down to reflect the proper name. I'm thinking I am not refreshing the list correctly.

    Front Page appears to add a lot of extra code in the pages. Makes it a bit more difficult to read. I would have cleaned it up, but I have to learn more about it first. (I tried using a tool that I found, but it cleaned up some necessary items and I couldn't run the script anymore)

    Thank you for your help.
    Attached Files Attached Files

  6. #6
    SitePoint Zealot Drew630's Avatar
    Join Date
    Nov 2001
    Location
    Maryland
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, your code is a mess to read through. One of the many reasons why I don't use FP. Anyway, I couldn't get much out of the code, since I am still unsure as to what you want to accomplish. Is the hidden variable that you are sending to the second form used in the SELECT stmt to get the info that you want to display? Or, is that hidden variable the item that gets displayed?

    A link to your page would probably be more helpful than the code you provided, simply because we could see what it is the page is doing. Reading the code provided didn't give me a clear picture as to what you want to accomplish. If I can get a clear idea, I will be able to look for something specific in the code, instead of trying to interpret what it is doing as a whole.

    One thing I would definetly look into is making sure that when you populate your second drop-down box, you clear it's contents in the beginning, to make sure you clear out all the previous values.

    Drew
    ~Drew

    There Is No Greater Joy Than Soaring High On The Wings Of Your Dreams, Except Maybe The Joy Of Watching A Dreamer Who Has Nowhere To Land But In The Ocean Of Reality.

  7. #7
    SitePoint Member
    Join Date
    Jul 2003
    Location
    Abbotsford
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Figured it out, now I have a new problem

    Ok, I did manage to get the issue with the drop down list sorted out. Now I have a new problem. The drop down list code is as follows :

    <SELECT SIZE="1" NAME="CustomerID" onChange="document.CustInfoF1.submit()">
    <!--#include file="_fpclass/fpdbrgn1.inc"-->
    <OPTION <% IF Request.Form("CustomerID") = FP_FieldHTML(fp_rs,"CustomerID") THEN Response.Write("selected") END IF%>
    VALUE="<%=FP_FieldHTML(fp_rs,"CustomerID")%>"><%=FP_FieldHTML(fp_rs,"Company_Name")%></OPTION>

    So the value that I am passing back to the drop down list "CustomerID". I have a script that creates a menu I downloaded from the net and modified. I think the code for it submits the links as follows:
    function GoTo(){if(this.LinkTxt){status='';
    var HP=Nav4?this.LowLyr:this;
    LowItem(HP);
    this.LinkTxt.indexOf('javascript:')!=-1?eval(this.LinkTxt)cLoc.location.href=this.LinkTxt}}

    If I wanted to pass the parameter of the page I would do it right at the end before the two }}. Is this right? Would I pass it using the
    <%CustomerID%> ??


Bookmarks

Posting Permissions

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