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 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2004
    Location
    Hudson Valley, NY
    Posts
    147
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Question Javascript for dynamic listbox

    Hi gang!
    Is there a fairly simple javascript I can use to dynamically populate a listbox? I have a record update page on our intranet web site and some of the fields need to be literal lookups of columns in our SQL database. Any ideas for this java wannabe?
    Andy

  • #2
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since you are going to do a lookup on database you can use AJAX.
    To populate the list box dynamically.

    Code:
    var i=forms[0].listbox.length;
    
    forms[0].lisbox.options[i].text="something1";
    forms[0].lisbox.options[i].value="something1";
    i++;
    forms[0].lisbox.options[i].text="something2";
    forms[0].lisbox.options[i].value="something2";


  •  

    Posting Permissions

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