PDA

Click to See Complete Forum and Search --> : popup window


jewel
Jul 24th, 2005, 11:05 PM
i'm new to web programming...

how can i create a popup window that will accept values in text input and then i'll use those value in asp.net behind code..

script?


thanks,
jewel

mendhak
Jul 25th, 2005, 01:54 AM
Create a hidden field on the opener page, so that when you 'submit' in the popup window, it writes the values to the hidden field. You can then work with that value in codebehind.

jewel
Jul 25th, 2005, 05:16 AM
Create a hidden field on the opener page, so that when you 'submit' in the popup window, it writes the values to the hidden field. You can then work with that value in codebehind.

hi mendhak,

thanks, but I dont really understand what you mean with create a hidden field, so far this what i have

wfrmMain.aspx

<INPUT type="button" value="New DatabaseGroup" name="btnDG" onclick = "showDlgDG()">


<SCRIPT>
var sDGName="";
function showDlgDG()
{
showModelessDialog("dlgDG.aspx",window,"status:false;dialogWidth:300px;dialogHeight:300px");
}

function UpdateDGName()
{
idg.innerText =sDGName;
}

</SCRIPT>



dlg.html


<INPUT type="text" size="25" name="txtDG">
<INPUT type="button" value="Ok" name="btnOk" onclick="getDGName();window.close();">

<SCRIPT>
function getDGName()
{
var sData =dialogArguments;
sData.sDGName = txtDG.value;
sData.UpdateDGName();
}
</SCRIPT>


first it gives me error that txtDG is undefined...hmmm

then next if this works how can my code behind get the value?

Thanks so much!

jewel