• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

add a new text field at every press of a button

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a form which has a text field to take category name. I have a submit button which will read the category name and save it into the database.
The problem:
I want to create a 'Add' button by pressing which the page is displayed with a new text field created below the existing rows, retrieving the values also. This should happen until I press save button which will finally save all the categories I created so far.
How do I keep track of the values for every press of the 'Add' button?
Please help me.
Thank you.
-raj
 
Ranch Hand
Posts: 838
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I was wondering if you had tried DOM and, if not, do you think it may be of some use to you? I haven't done much of anything with it so this is purely a suggestion. Also, what are you using? Perl, JSP, ASP,...?
Rob
 
raj agastya
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply. I haven't tried DOM and moreover I don't want to.
Actually I am using JSPs in my application. I am able to create just one row i.e text field without using javascript but with an input parameter which sets a flag for the JSP.
But I want that continuously until I press save.
I heard that it could be done with Javascript and so this posting..
Please help me.
Thanks.
-raj
 
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don't want to add new fields into the DOM then the only way I can think of is by having fields in divs which you position off screen and then move to your column when you click the button.
I'm not sure if having fields in different divs within a single form would work. You'd have to experiment.
It would be easier to insert new fields though. Either that or use a text area and split up the text on the server into categories using the CRLF as a seperator.
Adam
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic