Question : ASP.NET,Javascript,Ajax: How to get a string from window.showModalDialog

Hi there,
I would like to know how I can get a string from a modal dialog and use it on the parent form using window.showModalDialog

Answer : ASP.NET,Javascript,Ajax: How to get a string from window.showModalDialog

When you call showModalDialog you do this:

var oReturnValue = showModalDialog(....);

Within showModalDialog, assuming your textboxes have IDs of "txtForename" and "txtSurname":


function terminate()
{
 var o = new Object();
 o.forename = document.getElementById("txtForename").value;
 o.surname = document.getElementById("txtSurname").value;
 window.returnValue = o;
}

 

Ram

Random Solutions  
 
programming4us programming4us