small javascript function problem

C

Craig G

i have the following jscript function


function OpenLookup(idname, lookupName, postBack)
{
var strReturn;
strReturn=window.showModalDialog('frmLookup.aspx?LOOKUP=' + lookupName +
'&PROFESSION=' + document.getElementById('txtProf').value
,null,'status:no;dialogWidth:520px;dialogHeight:375px;dialogHide:true;help:n
o;scroll:no');

window.alert(idname); --this is just me checking the idname

if (strReturn != null) document.getElementById(idname).value=strReturn;
}


the problem occurs in that the final statment can never find the control in
question. if i substitute idname with the actual field name it works fine.
why does it not recognise the value held within idname?
 

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,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top