JScript pass value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • IS

    JScript pass value

    Hi folks,

    Any ideas why this doesn't work?

    <SCRIPT LANGUAGE="JavaS cript">
    <!--
    f = document.forms[1];
    e = f.elements;
    str = new String(e[0].value);
    len = document.forms['testform'].d.options.leng th;
    document.forms['testform'].d.options[len] = new Option(str, '1');
    </script>

    Basicaly, I am trying to fill my combo box on a HTML page (SELECT OPTION field) manually, but the vallue I get every time is 'null', i.e. empty string.
    *Suspected error in the red line, since if I put in the last line "....new Option('some',' 1');" it works.

    I must have made some ridiculous error I can't see, so plz be free to make fun of me :))

    Thanks in advance.
    IS


Working...