Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with drop downs

    I have a form site that needs to do the following

    Drop Down 1: Choose a Property Type
    Drop Down 2: Choose a Value (based on DD1 Selection)
    Drop Down 3: Choose a Payment Type (based on DD2 Selection)
    Drop Down 4 or Text Box: With the Price (based on DD3 Selection)


    I have the first three Drop downs doing what I want, I cannot get the forth drop down to give me anything,

    The code is very long so I posted it to a website where you can see the code and the way it is supposed to act..

    PLEASE help

    http://www.laurelriverdesigns.com/Programming/ba.html

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    Giving it a quick look:
    One thing that makes it so long is you have the same function "selectChange()" repeated three times. It is only needed once.

    This is totally untested:
    Code:
      for ( x = 0; x < ItemArray.length; x++ ) {
        if ( GroupArray[x] == control.value ) {
         if (controlToPopulate.name == 'A') {
             controlToPopulate.value = x;
         } else { 
             myEle = document.createElement("option") ;
             myEle.setAttribute("value",x);
             var txt = document.createTextNode(ItemArray[x]);
             myEle.appendChild(txt);
             controlToPopulate.appendChild(myEle);
         }
        }
      }
    
    
    <input type="text" id="fourthChoice" name="A" size="32" style="font-weight: 700">

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the help, I have it working know


  •  

    Posting Permissions

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