input from a text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • devikacs
    New Member
    • Jun 2007
    • 96

    input from a text box

    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?
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by devikacs
    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?
    Every thing is possible. But can I get some details?

    Comment

    • devikacs
      New Member
      • Jun 2007
      • 96

      #3
      Originally posted by hsriat
      Every thing is possible. But can I get some details?
      Ya. 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

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by devikacs
        Ya. 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..
        Don't name them as text1, text2.... instead, name all of them as text[].

        Comment

        • devikacs
          New Member
          • Jun 2007
          • 96

          #5
          Originally posted by hsriat
          Don't name them as text1, text2.... instead, name all of them as text[].
          I 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>

          Comment

          • hsriat
            Recognized Expert Top Contributor
            • Jan 2008
            • 1653

            #6
            Originally posted by devikacs
            I 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

            Working...