-1

I am trying to save one report by clicking on button, it is working on IE 9 and IE 10 but not working on IE11 and Chrome. below is my On-click function

function SaveReport(thisUser)
{
    thisFormList  = opener.document.getElementById("hiddenFormList").value; 
    thisSortWhere = opener.document.getElementById("hiddenSortWhere").value; 
    if ( thisFormList == "" && thisSortWhere == "")
    {
        alert("Enter the criteria and click -Find- first");
        return false;
    }
}

My HTML code

<td align="center" style="padding-bottom:10px;"> New Report Name: 
<input type="text" name="newReport" size="50" maxlength="50">
<input type="button" name="SaveReportBtn" `enter code here`
value="Save" onclick="SaveReport('#Client.USERNAME#');" style="width:60px;">
Cyril Durand
  • 15,834
  • 5
  • 54
  • 62
user3468327
  • 1
  • 1
  • 2
  • 3
    Share your html code please. – Nzall Mar 27 '14 at 12:51
  • New Report Name: – user3468327 Mar 27 '14 at 13:13
  • 1
    You can edit your own post (edit text beneath your question) and paste in the code so you can format it properly. – Nzall Mar 27 '14 at 13:14
  • Please indicate which line the error occurs on. The thing before the `.value` is null. Fix that. – Raymond Chen Mar 27 '14 at 15:22
  • I am getting value null at below line this is working fine in IE9 and 10 so there is a value. I am getting this issue for some other fields in IE11 as well as some button functionality also not working in IE11 and Chrome thisFormList = pener.document.getElementById("hiddenFormList").value; – user3468327 Mar 27 '14 at 15:38

2 Answers2

1

try using

opener.document.forms[0].hiddenFormList.value 

instead of

opener.document.getElementById("hiddenFormList").value

I was facing the same issue in IE11. It seems due to some reason, getElementById is not very responsive in IE11.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
Rajan
  • 11
  • 1
0

I suspect you're doing this with local files, rather than files served via http. That is, the URL of the page starts with file: rather than http: or https:.

The problem is that some browsers, including Chrome, apply the Same Origin Policy to local files — that is, one window opened from a local file path cannot access another window opened from a local file path, as though it were a cross-domain request (even though they're both local, and even if they're from the same directory). Others allow it.

If you serve the files via http, and they're from the same origin, I suspect you'll find the problem goes away.

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
  • Thank you for your Quick reply but I am facing this issue even I serve the files via http (running through my test server not in local) – user3468327 Mar 27 '14 at 15:17