Hi,
I am using DynaActionForm. I am creating a bean of size 10 an iterating it over in my
jsp to create 10 text fields. My bean contains 4 fields.
So basically there are 4 columns(Prod Desc, Nett Price, Quantity and UOM) in a row and there are 10 such rows. UOM is one such column which is a drop down.
What i want is: If the user selects any value from the UOM drop down then all the 10 UOM text fields should be filled with the value selected.
struts-config :
<form-bean name="purchaseOrderBeanForm" type="org.apache.struts.action.DynaActionForm">
<form-property name="lines" type="ActionForm.AddPOBean[]" size="10" />
<form-property name="selected" type="java.lang.String" />
<form-property name="arrCustID" type="java.util.ArrayList" />
<form-property name="UOM" type="java.lang.String" />
<form-property name="POB2B" type="java.lang.String" />
<form-property name="POTX" type="java.lang.String" />
<form-property name="PONO" type="java.lang.String" />
</form-bean>
my jsp:
<tr>
<td >S/No.</td>
<td > Product Description</td>
<td >Nett Price (Without Tax)</td>
<td>Quantity</td>
<td> UOM </td>
<td>
<html:select property="UOM" onchange="changeValue(this.value);">
<html:option value="nos."></html:option>
<html:option value="kg"></html:option>
</html:select></td>
</tr>
<% int i = 1; %>
<logic:iterate id="lines" name="purchaseOrderBeanForm" property="lines">
<tr>
<td><%=i %></td>
<td ><html:text indexed="true" name="lines" property="POD"/></td>
<td ><html:text indexed="true" name="lines" property="PON"/></td>
<td><html:text indexed="true" name="lines" property="POQ" size="6"/></td>
<td></td>
<td><html:text indexed="true" name="lines" property="UOM1" size="4" value="nos."/></td>
</tr>
<% i++; %>
</logic:iterate>
my function:
function changeValue(value)
{
var weight = value;
alert(weight);
alert(document.purchaseOrderBeanForm.lines[0].UOM1.value);
}
I am not getting the 2nd alert
Thanks.