By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,779 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,779 IT Pros & Developers. It's quick & easy.

JScript pass value

P: n/a
IS
Hi folks,

Any ideas why this doesn't work?

<SCRIPT LANGUAGE="JavaScript">
<!--
f = document.forms[1];
e = f.elements;
str = new String(e[0].value);
len = document.forms['testform'].d.options.length;
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
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.