I’m trying to send the values of selected checkboxes from a popup form back to it’s parent window.
I launched a modal popup window which forces the user to interact with that window then send the info back to the field that i want to populate.
However it does not send the info back. i’m really at a loss here as to why this last step is not working.
===================================
These are the functions on the Parent window.
[COLOR=blue] function myReasonDialog(){
var myReason;
}
function openReasonPickerDialog(wnd, change, dlgURL)
{
myReasonDialog.myReason=” “;
if(wnd.showModalDialog(
dlgURL,
myReasonDialog,
“dialogHeight:190px;dialogWidth:200px;”)
== true )
{
change.value = myReasonDialog.myReason;
}
else
{
return;
}
}
This is the function on the child window:
[COLOR=blue]
function sendAndClose( reason, vType){
var fld = window.document.forms[0].reason;
thevalue = ” “;
sep= ” “;
hits = 0;
if (vType == “checkbox”) {
if (reason.value == null) {
for (i =0; i < reason.length; i ++)
{
if ( reason[i].checked) {
hits++
if (hits > 1) {
sep = ” , ” ;
}
thevalue += sep + reason[i].value;
{
window.dialogArguments.myReason =
thevalue.value;
window.returnValue=true;
window.close();
}
}
}
}
}
}
This is the code that is attached to a button that is supposed to send the data back to the parent form.
sendAndClose(this.form.reason);
=============================================
I’m fairly new to javascript so I would appreciate it if anyone could tell me why when I click on the ok button on the popup window, nothing happens.
I was able to make it work using similar code with a select object.