which part do you mean? Is this? <html:form action="projection.do"> ... <logic:iterate id="loop" indexId="idx" name="data"> ... <td class="celBorder"> <html:select name="loop" property="sts_1" onchange="checkStsCombo(this, 'hasil_1', '<%=idx%>');"> <html:option value=""></html:option> <html:options collection="listSts" property="value" labelProperty="description"/> </html:select> </td> <td class="celBorder" valign="top"> <html:text indexed="true" name="loop" property="hasil_1" size="3"/> </td> ... </logic:iterate> ... </html:form> ... <script> ... var validStatus = new Array ("PCB","PCS","PCK","RC"); function checkStsCombo(combobox, fieldName, idx) { var index = combobox.selectedIndex; var selected = combobox[index].value; var name = 'loop[' + idx + '].' + fieldName; var valid = false; for (i = 0; i < validStatus.length; i++) { if (validStatus[i] == selected) { valid = true; break; } } if (valid) document.getElementById(name).readonly = true; else document.getElementById(name).readonly = false; } </script>
The main problem is why i can't get the '<%=idx%>' value? it should be rendered as integer value (i.e. '0','1',etc) in the html file. Ravindar T wrote: > > where are getting the values for select either from bean or request > attribute. > > > > On 10/10/07, Benz <[EMAIL PROTECTED]> wrote: >> >> >> this is my part of jsp: >> .... >> <logic:iterate id="loop" indexId="idx" name="data"> >> .... >> <html:select name="loop" property="sts_1" onchange="checkStsCombo(this, >> 'hasil_1', '<%=idx%>');"> >> ... >> </html:select> >> ... >> </logic:iterate> >> ... >> >> I get the html result: >> ... >> <select name="sts_1" onchange="checkStsCombo(this, 'hasil_1', >> '<%=idx%>');"> >> ... >> >> The '<%=idx%>' text in jsp should be rendered as the value of idx valu >> which >> is such as '0','1',etc. >> Can anybody tell me why it doesn't works? >> >> Best Regards, >> >> Benz >> -- >> View this message in context: >> http://www.nabble.com/html%3Aselect-javascript-onchange-passing-parameter-problem-tf4598318.html#a13128698 >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > Ravindar T > Developer Analyst, > HotCourses Ltd, > [EMAIL PROTECTED] > > -- View this message in context: http://www.nabble.com/html%3Aselect-javascript-onchange-passing-parameter-problem-tf4598318.html#a13130785 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]