• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

dynamically adding forms when a button is clicked on page

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys.

1. When the page is initially entered, an 'Add' button is displayed
2. When user clicks 'Add', a form with 1 input text and a 'Start' button will appear. When he clicks 'Start', an ajax post will process, passing his input.
3. At any time (even if the ajax is still processing), the user can click 'Add' button again to add a new input text and 'Start' button. He could also add new field and click add.

How can I tell in jsp that the start button is for first form, second start button is for submitting second form and so on?
Need your ideas please.... TIA
 
Sheriff
Posts: 67634
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each form has its own Start button? Simple, make the button a submit button and use a submit handler to submit the form via Ajax. (jQuery Forms Plugin makes this trivial.)

Not a JSP question: moved to HTML.
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic