I am trying to input a set of text values to a form.i am using jsp. I would like to store them in say a list or array. is it possible to do that?
input from a text box
Collapse
X
-
Originally posted by hsriatEvery thing is possible. But can I get some details?
SO jsp puts the values in sepearate strings, text1,text2,etc .. Would it be possible to change this to an array or list..Comment
-
Originally posted by devikacsYa. I need some textboxes.. the number of textboxes is dynamic. So right now, i have put them in a loop and called them text1,text2,etc
SO jsp puts the values in sepearate strings, text1,text2,etc .. Would it be possible to change this to an array or list..Comment
-
Originally posted by hsriatDon't name them as text1, text2.... instead, name all of them as text[].
<td><input type='text' name=<%="text["+i+"]"%> disabled ></td>
which is why i changed it to
<td><input type='text' name=<%="text"+ i%> disabled ></td>Comment
-
Originally posted by devikacsI tried doing this, but it did not work..
<td><input type='text' name=<%="text["+i+"]"%> disabled ></td>
which is why i changed it to
<td><input type='text' name=<%="text"+ i%> disabled ></td>
Don't use jsp in between... just leave all the inputs look like [HTML]
<input type="text" name="text[]" disabled >[/HTML]Comment
Comment