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
btw. if I put up an event at the Text field (onChange) the values can be transfered to my combo box trought a function call, but are lost as soon as I press Submit button I have next to my Text field.
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
btw. if I put up an event at the Text field (onChange) the values can be transfered to my combo box trought a function call, but are lost as soon as I press Submit button I have next to my Text field.
Comment