popup window: Return value to correct text box?

M

Mel

Hi, I have two text boxes and two image buttons. When I click either
image button the same popup window is shown. When I click image
button #1 the returning data is put in text box #1 (txtAng1.Text).
When I click image button #2 the returning data is also put in text
box #1; it should be placed in text box #2 (txtAng2.Text)! How do I
fix my code to put the returned data into the correct text box?
-------------------------------------------------------------------------
(using Asp.net 2.0, vb.net, javascript)
PARENT WINDOW ASPX CODE SNIPPET
<script language="javascript" type="text/javascript">
function update(elemValue)
{
document.getElementById;
document.getElementById('<%=txtAng1.ClientID
%>').innerText=elemValue[0];
}
</script>

PARENT WINDOW ASPX.VB PAGE_LOAD() SNIPPET
OpenPopUp(imgAng1, "AngleCalc.aspx", "", 420, 250)
OpenPopUp(imgAng2, "AngleCalc.aspx", "", 420, 250)

POPUP WINDOW ASPX CODE SNIPPET:
<script language="javascript" type="text/javascript">
function Done()
{
var Angle=document.getElementById('txtAng').value;
var ret= new Array(Angle);
window.opener.update(ret);
window.close();
}
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top