HI,
I am creating a page using javascript and dom. when i go to the new window and press abutton after selecting a option from a dropdown menu the table shoub appear within the same new page .
Here is my piece of code I am not able to pass and print the value of selected option needed to generate a complete table.
=============== =========
[CODE=javascript]function y()
{
nwin=open("","" ,"");
nwin.document.o pen();
//nwin.document.w rite(xmlDoc.doc umentElement.ch ildNodes[0].childNodes[0].text);
var it=xmlDoc.docum entElement.chil dNodes[0].getElementsByT agName("item");
var le=it.length;
nwin.document.w rite("<form id='f1'><select id='s1'>")
for(var i = 0; i <le; i++)
{
n = it.item(i);
nwin.document.w rite("<option value=\""+i+"\" >"+n.childNod es[0].text+"</option>");
}
nwin.document.w rite("</select><input type='button' value='get details' onclick='fun(); '></form>");
function fun()
{
var r=document.f1.s 1.selectedIndex ;
var outstring="<b>" + r +"</b>"
document.inside .innerHTML=outs tring;
}
nwin.document.w rite("<div id='inside'></div>");
nwin.document.c lose();
}[/CODE]
Thanks in advance
I am creating a page using javascript and dom. when i go to the new window and press abutton after selecting a option from a dropdown menu the table shoub appear within the same new page .
Here is my piece of code I am not able to pass and print the value of selected option needed to generate a complete table.
=============== =========
[CODE=javascript]function y()
{
nwin=open("","" ,"");
nwin.document.o pen();
//nwin.document.w rite(xmlDoc.doc umentElement.ch ildNodes[0].childNodes[0].text);
var it=xmlDoc.docum entElement.chil dNodes[0].getElementsByT agName("item");
var le=it.length;
nwin.document.w rite("<form id='f1'><select id='s1'>")
for(var i = 0; i <le; i++)
{
n = it.item(i);
nwin.document.w rite("<option value=\""+i+"\" >"+n.childNod es[0].text+"</option>");
}
nwin.document.w rite("</select><input type='button' value='get details' onclick='fun(); '></form>");
function fun()
{
var r=document.f1.s 1.selectedIndex ;
var outstring="<b>" + r +"</b>"
document.inside .innerHTML=outs tring;
}
nwin.document.w rite("<div id='inside'></div>");
nwin.document.c lose();
}[/CODE]
Thanks in advance
Comment