Mango Mango - 5 months ago 23x
Javascript Question

get the data selected from Jquery dialog to the parent page

I've used JQuery dialog to open a popup which contains image

<script type="text/javascript">
jQuery(document).ready( function(){
jQuery("#btnAddWidget").click( showDialog );

$myWindow = jQuery('#widgetDialog');

$myWindow.dialog({ height: 350,
width: 400,
modal: true,
position: 'center',
title:'Add Widget',
overlay: { opacity: 0.5, background: 'black'}

var showDialog = function() {

var closeDialog = function() {

In the dialog

<div class="headerlinks">
<input id="btnAddWidget" name="addWidget" value="Add Widget" type="button" />
<div id="widgetDialog" style="display:none">
<img border="0" id="imgRMS" src="sample.jpg" />
<input id="btnAddToDashboard" name="addToDashboard" value="Add To Dashboard" type="button" />

In the parent page

<div id="dashboard" class="dashboard">
<div id="w1" class="column"></div>

On click of "Add to Dashboard" I want the image to be placed in the respective div
of the parent page.
Can anyone suggest something on this..???