Closed Thread
Results 1 to 3 of 3

Thread: Help Please.

  1. #1
    timmi is offline Newbie
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Help Please.

    Hi all,

    I,m trying to add a function that will add a text field only when the other option is selected in a dropdown list.

    I'm new to Javascript and your help would be most appreciated.

    Many thanks in advance.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    alienkinetics's Avatar
    alienkinetics is offline Programmer
    Join Date
    Feb 2010
    Location
    Australia
    Posts
    154
    Rep Power
    0

    Re: Help Please.

    Um, have you thought about providing your source code?

    What, are people ment to pull code out of our asses?
    Buzz PHP Class Library - Web Components Made Easy!
    http://www.buzzphp.com/

  4. #3
    timmi is offline Newbie
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Re: Help Please.

    Apologies... My fault

    function addOption(selectbox,text,value )
    {
    var optn = document.createElement("OPTION");
    optn.text = text;
    optn.value = value;
    selectbox.options.add(optn);
    }
    addOption(document.drop_list.names_list,”Tom”, “Tommy”);
    var names = new Array("Tom","Tommy","Andy,"Mike","Ron","Other");
    for (var i=0; i < name.length;++i){

    addOption(document.drop_list.names_list, name[i], name[i]);
    }

    What I wanted to do was add a text field if the "Other" option is selected.

    Many thanks in advance

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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