Click here to Skip to main content
11,647,170 members (69,973 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Hi,

I'm using master page in the parent page.

When I'm opening the child page and use the below code

window.opener.document.forms(0).abcd.value is null or not an object

string strScript = "<script>window.opener.document.forms(0).abcd.value" + " = '" + textbox1.text + "';";
strScript += "self.close()";
strScript += "</" + "script>";
RegisterClientScriptBlock("abcd", strScript);

I have also used the
1. window.document.getElementById('abcd').value
2. window.opener.document.forms[0].abcd.value
3. window.opener.document.forms['form1'].elements['abcd'].value
4. window.opener.document.forms[0].elements['abcd'].value
5. self.opener.document.abcd.value

instead of

window.opener.document.forms(0).abcd.value

but neither of them worked for me

Please help me on this

Thanks in advance.

Rahul
Posted 12-Jan-11 17:22pm
Edited 13-Jan-11 18:10pm
v5
Comments
Kasson at 12-Jan-11 23:27pm
   
What versions of IE and Netscape would not support it?
Ankur\m/ at 13-Jan-11 0:42am
   
Use 'Add Comment' link below an answer to discuss anything with the answerer. It notifies the user.
On the other hand adding an answer doesn't notify him and he may never know that you asked him something.
Dalek Dave at 13-Jan-11 4:22am
   
Edited for Grammar and Readability.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Dear Friend
Instead of using document.forms(0).abcd.value
use
document.getElementById('myText').value;
as it will give you more precise result

you can also assign the value returned by the function to a variable and perform operation on it
eg:-
  var DivValue=document.getElementById('DivValue');
  alert(DivValue); 


Regards
Vipin Kumar Mallaya
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

Hi All


The problem is resolved

where i removed the runat="server" tag from the text box and uses

window.opener.document.getElementById('abcd').value

instead of

window.opener.document.forms(0).abcd.value
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 jyo.net 500
1 OriginalGriff 337
2 DamithSL 310
3 Sergey Alexandrovich Kryukov 265
4 CPallini 249
0 OriginalGriff 1,277
1 jyo.net 994
2 DamithSL 946
3 Sergey Alexandrovich Kryukov 853
4 CPallini 760


Advertise | Privacy | Mobile
Web03 | 2.8.150804.2 | Last Updated 14 Jan 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100