Forums

This topic is locked

display value to textbox - assigned by a js functi

Posted 26 Aug 2005 07:26:25
1
has voted
26 Aug 2005 07:26:25 tll cll posted:
Hi,
I would like to know how to display the value to textbox 'po_um' which assigned from poLnChk() function. I manage to get the var d_po_um displayed in the alert box as 'document.all.po_um1.value = 'UT' for row 1, the alert message also show 'document.all.po_um2.value = 'UT' for row 2 - which both are correct. But I can't get the value display in the text box of 'po_um'.

I have tried the following statement but give object null:
document.all.po_um(poLnCnt).value = '<%=j_po_um%>';

what is the syntax to assign the value to document.all.po_um(javascript variable/value).value? the above doesnt work. I have tried putting d_po_um only also doesnt work

Pls help

script
====
function poLnChk(obj, poLnCnt, po_num){
d_po_um = "document.all.po_um" +eval(poLnCnt) +".value = " +"'<%=j_po_um%>'";
alert (" ppppp " +d_po_um );
//document.all.po_um(poLnCnt)].value = '<%=j_po_um%>';
//document.all.po_um[poLnCnt].value = '<%=j_po_um%>';
//d_po_um
}

<html>
<%
int i;
for (i=1;i<=15;i++) {%>
<tr>

<td>
&lt;input type="text" name="po_ln&lt;%=i%&gt;" style="width:100%;text-align:right;" onChange="poLnChk(this,&lt;%=i%&gt;, po_num&lt;%=i%&gt<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>"&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;input type="text" name="po_um&lt;%=i%&gt;" style="width:100%" disabled&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/html&gt;




Reply to this topic