struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Puneet Lakhina" <puneet.lakh...@gmail.com>
Subject Re: DHTML and Struts
Date Wed, 02 Aug 2006 04:48:43 GMT
>
>
> you were hung up (maybe I read into your question incorrectly).  So are
> you actually hung up on the JavaScript to dynamically add fields?



Yes, i am able to add text fields to my page, but I dont know what all
attributes to specify in the input tag so that my user bean recieves the
values from the dynamically added text fields.

i.e.
<script language="javascript>
count=1;
function add()
{
var row = document.getElementById('t1').insertRow(count);
var cell=row.insertCell(0);
cell.innerHTML="<input type=text name=foo[" + count + "]" +  "/>
count++;
}
</script>
<input type="button" onclick="add()" />
<table id="t1">
<tr>
  <td>
    <html:text property="foo[0]" >
  </td>
 </tr>
</table>
</table>

-- 
Puneet

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message