aodhan
07-29-2003, 06:45 AM
I am trying to write some JavaScript code that open a new window and within this window sets up a drop down menu. I want this to call some function when I change a value in this box using onChange(). I am not sure if I am attempting this correctly. What I do is create a new window called d using the command d.write I try to add a form with all the details of menu in it. Any help on this matter would be greatly appreciated. Please find the code below:
the function test() gets called from a function elsewhere
function test(){
var d = 0;
var addWindow = window.open();
d = addWindow.document;
d.write('Please Select an option');
d.write("<FORM>type:<SELECT NAME='fieldType' onchange='tester()'><OPTION SELECTED VALUE='hidden'>hidden<OPTION VALUE='text'>text<OPTION VALUE='radio'>radio<OPTION VALUE='checkbox'>checkbox <OPTION VALUE='button'>button <OPTION VALUE='submit'>submit </SELECT>")
}
Maybe I am not even trying to do this the correct way!!
the function test() gets called from a function elsewhere
function test(){
var d = 0;
var addWindow = window.open();
d = addWindow.document;
d.write('Please Select an option');
d.write("<FORM>type:<SELECT NAME='fieldType' onchange='tester()'><OPTION SELECTED VALUE='hidden'>hidden<OPTION VALUE='text'>text<OPTION VALUE='radio'>radio<OPTION VALUE='checkbox'>checkbox <OPTION VALUE='button'>button <OPTION VALUE='submit'>submit </SELECT>")
}
Maybe I am not even trying to do this the correct way!!