I am trying to populate a selectbox from another window that is open.
I can populate a textbox but i cant figure out the selectbox
This is what ive got w/ a error, the error occures on the line
that i try to populate the selectbox.
Test1.asp
[code]
<form name=form1 method=post>
<select name=”txtFiles”>
<option value=1>Test1</option>
<option value=2>Test2</option>
</select>
<input type=text name=txtAttachments value=””>
<a href=”Test2.asp” target=”_Blank();”>Open Window</a>
</form
Test2.asp
[code]
<script language=javascript>
function AddOption(){
var i = window.opener.document.form1.txtFiles.options.length + 1;
alert(i);
window.opener.document.form1.txtAttachments.value=’Test Done’;
window.opener.document.form1.txtFiles.options[i] = new Option(‘asdfasdf’, i);
}
</script>
<form name=form method=post>
<input type=button name=cmdAdd value=”Add” Onclick=”AddOption();”>
</form>