Click here to Skip to main content
15,570,131 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Scenario is I have one parent and on child page. Child page contain list of say countries. I was using showModalDialog function in java script which is easily returned the value I had selected in my child page. Recently this functionality is not working in chrome as in new update they have deprecated showModalDialog function. Please suggest me some alternative to achieve this.
I tried same using different methods but issue I am facing is there are multiple values returning from child which I have to split and assign to my hidden values in parent:
This is my Parent code:
XML
function Display_Session_Year(obj,obj_desc,Steps)
       {
           var retVal;
           strPage = "PopUpHelper.aspx?PageName=Pop_Commodity_warehouse_session.aspx&Steps=" + Steps;
           DialogWidth="dialogWidth:500px; dialogHeight:550px;Center:yes; scroll:yes ;resizable:no;status:no;";
           retVal=window.showModalDialog(strPage,'',DialogWidth);
           if(retVal!="" && retVal!=null)
           {

               var ArrValues=retVal.split("~")


               document.getElementById(obj).value = ArrValues [0];
               document.getElementById(obj_desc).value = ArrValues [1];
               document.getElementById('<%=txt_seasonyearDesc.ClientID%>').value = ArrValues [3];
            //document.getElementById(obj_desc).focus();
          document.getElementById('<%=txt_seasonyearDesc.ClientID%>').focus();
        }
    }


This is child page code:
C#
function Returnval(Val)
        {
         top.returnValue= Val
        parent.window.close();
    }
Posted
Updated 14-Oct-14 4:23am
v3

 
Share this answer
 
Comments
Archana Gaikwad 6-Nov-14 3:06am    
No this is not helping me because I have one popup screen opening from other pages as well. I can't set parent page controls on this popup using window.open method
may be you can get the answer here
' window.ShowModalDialog ' not working in Chrome[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900