I have Dynamic row, which contains 4 fields (item ,qty , rate and total). onclick i get a row of this group..for a item i have a selection box,is fitched by db table.
am able to do for only one row or it may get effect to all row.. stucking up in if statement.
My question is how to get selected item in textarea, for dynamic rows..
function get_val5( tot_val )
{
var frm=document.forms[0],flds=[frm['abc5'],frm['itemName']];
alert(" Before for ");
for (var z0=0;z0<flds[0].length; z0++)
{
alert("after for loop");
// stucking up in if statement,
// if (flds[0][z0].onchange() = change)
// if (flds[0][z0].window.onchange() = change)
//if (flds[0][z0].options.length>0)
if (flds[0][z0].getAttribute("value"));
//if (flds[0][z0].val(this.getAttribute("value"));
{
alert("inside if ");
flds[1].value = tot_val;
}
}
}
<td width="67" align="center" height="21"><input type="text" name="headline" value="" size="40" />
<textarea name="itemName" rows="2" cols="52" class="incId"> </textarea>
<font size="2" face="Swiss" id="hiderow">Select Item Name</font>
<font color="red" id="hiderow">*:</font>
<select class="incSel" name="abc5" id="hiderow">
<%
while (rsa.next()) {
%>
<%
tot_val = rsa.getString("item_desc");
%>
<option onclick="get_val5('<%= tot_val %>');"><%=rsa.getString("item_name")%>
</option>
<%
}
%>
</select> <a href="ItemPO.jsp" onclick="return popitup('ItemPO.jsp')"
id="hiderow"><font size=1>New</font></a></td>