Hi,
I have a form which asks the user to fill out 2 fields for each customer. I dont know how many customers there will be, an array list is populated before hand and I'm using a logic:iterate to create a form listing each one.
The HTML looks a bit like:
The form looks a little like:
My question is, how will I know which element in my [blue]comment[/blue] string array matches with which [blue]refChecked[/blue] value ?
Is there a better way to keep these in sync, so I can be confident when I'm processing my form, that I'm matching the right comment with the right refChecked value.
Could I perhaps use a 3d array in my java form ? if so, how would I reference this in my html ?
I have a form which asks the user to fill out 2 fields for each customer. I dont know how many customers there will be, an array list is populated before hand and I'm using a logic:iterate to create a form listing each one.
The HTML looks a bit like:
Code:
<form name="SSCMHomeForm" method="post" action="/sscm/SSCMHomeAction.do">
<TR>
<!-- CheckBox -->
<TD width="20">
<input type="checkbox" name="refChecked" value="653"/>
</TD>
<TD width="100">
<input type="text" name="comment"/>
</TD>
</TR>
<TR>
<!-- CheckBox -->
<TD width="20">
<input type="checkbox" name="refChecked" value="635"/>
</TD>
<TD width="100">
<input type="text" name="comment"/>
</TD>
</TR>
</form>
The form looks a little like:
Code:
public class SSCMHomeForm extends ValidatorForm {
private String[] refChecked = null;
private String[] comment = null;
public String[] getRefChecked() {
return refChecked;
}
public void setRefChecked(String[] strings) {
refChecked = strings;
}
public String[] getComment() {
return comment;
}
public void setComment(String[] strings) {
comment = strings;
}
}
My question is, how will I know which element in my [blue]comment[/blue] string array matches with which [blue]refChecked[/blue] value ?
Is there a better way to keep these in sync, so I can be confident when I'm processing my form, that I'm matching the right comment with the right refChecked value.
Could I perhaps use a 3d array in my java form ? if so, how would I reference this in my html ?