|
javascript writeln problem
Hi,
I am having a problem with a javascript.write call.
I have the following inserted in my html:
<SCRIPT LANGUAGE="JavaScript">
<!--
document.writeln('<SELECT NAME="SelectMenu">');
tot = countrylist.length;
for (var i = 1; i <= tot; i++)
document.write("<OPTION>" + countrylist[i]);
document.writeln('</select>');
//-->
</SCRIPT>
with the following in a <script> tag at the top of my page:
var countrylist = new MakeArray("Select an area",
"Belfast",
"Benenden",
"Bethnal Green",
"Bradford",
"Bristol",
"Canary Wharf",
"Cardiff",
"Wolverhmptn");
For some reason it writes in the <select> tags but does not input the <option>'s.
So I end up with a select list with nothing to select.
Can anyone see where I may have gone wrong?
regards
calum
|