aodhan
07-22-2003, 04:57 AM
I have a problem with using a selectbox within my javascript code. I can get the code to display the box but when I click on it I cannot get it to work.
I am opening a new window in javascript and into it I wish to put a selection box. When a user selects an option within this list I want this to call another function within my code. I have tried using onChange (see below) but I am not able to get this to work. Any help would be greatly appreciated.
function a()
{
var win = 0;
var win1 = window.open();
win = win1.document;
d.write("<form> <select name ='test' value='t' onChange= 'b()'><option value = 'one'>ONE<option value='two'>TWO</select></form>");
}
function b()
{
alert('Hello World');
}
I am opening a new window in javascript and into it I wish to put a selection box. When a user selects an option within this list I want this to call another function within my code. I have tried using onChange (see below) but I am not able to get this to work. Any help would be greatly appreciated.
function a()
{
var win = 0;
var win1 = window.open();
win = win1.document;
d.write("<form> <select name ='test' value='t' onChange= 'b()'><option value = 'one'>ONE<option value='two'>TWO</select></form>");
}
function b()
{
alert('Hello World');
}