ceema
asked on
window.opener function
Hello,
I am using the following code to pass data from a prent window to a child window(I am using aspx). For that I am using the code in my aspx page. In my aspx page of parent, I am having two fileds TxtRegNo as text box, and T1 as list box. To my textbox, I am getting the exact value, but to my list box, it's showing error, can any one help me, to pass value to my listbox in aspx page.
Thnaks
Ceema
Code:
<head>
<SCRIPT language="JavaScript">
<!--
function pick(RegNo,SName,LClass) {
if (window.opener && !window.opener.closed)
window.opener.document.For m1.TxtRegN o.value = RegNo;
window.opener.document.For m1.T1.valu e = LClass;
alert(LClass);
window.close();
}
// -->
</SCRIPT>
</HEAD>
Actually my LClass is the value I am getting after reading the database. for example...
I have three classes in my table ClassDetails
ClassID ClassName
203 1-A
208 3-B
509 3-A
In LClass, I am getting 208 for example. So
window.opener.document.For m1.T1.valu e = 208. Now my parent window, I have a list box having all these three values, my aim is to disply 3-B as seleted in the parent window, with the other values also in list box.
If some one can help me, I am so thankful.
I have tried window.opener.document.For m1.LYear.o ptions[LYe ar].select ed, but in some cases it's not working
Thank you once again,
Ceema
I am using the following code to pass data from a prent window to a child window(I am using aspx). For that I am using the code in my aspx page. In my aspx page of parent, I am having two fileds TxtRegNo as text box, and T1 as list box. To my textbox, I am getting the exact value, but to my list box, it's showing error, can any one help me, to pass value to my listbox in aspx page.
Thnaks
Ceema
Code:
<head>
<SCRIPT language="JavaScript">
<!--
function pick(RegNo,SName,LClass) {
if (window.opener && !window.opener.closed)
window.opener.document.For
window.opener.document.For
alert(LClass);
window.close();
}
// -->
</SCRIPT>
</HEAD>
Actually my LClass is the value I am getting after reading the database. for example...
I have three classes in my table ClassDetails
ClassID ClassName
203 1-A
208 3-B
509 3-A
In LClass, I am getting 208 for example. So
window.opener.document.For
If some one can help me, I am so thankful.
I have tried window.opener.document.For
Thank you once again,
Ceema
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for the reply. Both are working fine, but second one is little bit faster I think. Thank you so much for the help. I am spliting the points.
Thank you so once again for the solution.
Regards
Ceema