Pass Value From Parent Form to Child Form using javascript showModalDialog

前端 未结 3 904
花落未央
花落未央 2021-02-10 15:41

if i want to pass in my value for confirmation box!!! so lets say i want to delete item no 1 so i checked the check box then when i pressed the delete button. the popup box come

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-10 16:06

    Suppose we have the WindowTrigger.aspx which contains a button as shown below and which invokes the following script and executes and which opens the new page WindowContainer.aspx using showModalDialog.

         
    
     
    

    The above script contains the array declaration 'theAdmin' which is passed to Child window using 2nd argument as shown

    The following code is in WindowContainer.aspx which contains a listbox and a button,on click of the button the argument will get intialized to corresponding selected Texts and selected Values of the listbox.

        
           
           
            
         
    
     
    

    Now the output will be "044;040;" and "Chennai;Hyderabad;" respectively.In this way we can pass values(here theAdmin) from parent form to child form,and the result can also be used in parent form(there is no lose of scope to the parameter).

提交回复
热议问题