A javascript Error
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hemen_Thacker
Posted On:   Saturday, November 3, 2001 08:09 AM

New Page 3 function abc() { var a=open("tmp1.html","hello"); } function abc1() { f1.T1.value="pqr"; } ]]>]]> function bac() { coll=opener.document.all.tags("select") var oOption = document.createElement("OPTION"); oOption.text="Apples"; oOption.value=5; alert(coll[0].options[0].text); coll[0].add(oOption); } ]]>]]> I am trying to insert a option into a select tag in parent window from a child. It give "the Server threw an exception". I have two html Files File 1 dhgfgd onchange="abc1();">  File2 N   More>>
New Page 3

I am trying to insert a option into a select tag in parent window from a child. It give "the Server threw an exception".

I have two html Files


File 1









onchange="abc1();"> 













File2




New Page 1







onclick="bac();">










run the file1 click on the button it open a new window click on the button it give you the error.



Does someone has any Idea?



Thanks
Hemen    <<Less

Re: A javascript Error

Posted By:   Firat_Tiryaki  
Posted On:   Monday, November 5, 2001 01:15 AM

Honestly, i didn't read your code. To insert a new option use the code below



myOption= new Option();

myOption.text="option text here";

myOption.value="option value here";

document.formName.selectName.options[document.formName.selectName.length]=myOption;

About | Sitemap | Contact