• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to access data from the elements added via javascript dynamically using the jsp code.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Urgent..Anyone please Assist
how to access data from the elements added via javascript dynamically using the jsp code.
i am adding empty records on .jsp page using following javascript (by calling a below function on click event of button) as

:-

var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "text";
element1.value="";
cell1.appendChild(element1); //and so on for 5 columns too

Main problem is that i am not able to access these dynamically added textboxes values from my jsp code. (because

they have been created dynamically by javascript)

Now,i want to save the value from these dynamically added textboxes(in form of table) from the .jsp page to

database using jsp...(there can be several rows generated depending upon user input)
or else suggest me code to create them dynamically so that i can fetch data from added dynamic textboxes on jsp

page.
And please ..i don't want to go for servlet concept...wants using jsp only..

thnks ....
 
Sheriff
Posts: 67746
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

wonder boy wrote:And please ..i don't want to go for servlet concept...wants using jsp only..



Fail. You have already go off the rails.

That's like saying "I want to build a car, but only using a screw driver"

You need to use multiple tools, and each for what it does best. JSP is for presentation. Java code should be in a servlet and other Java classes.

As far as your JavaScript issue -- JSP executes on the server to format the page to send to the browser. Once that is done, there is no more JSP activity. Nothing will change that. You need to back up a bit and learn how JSP works so you can figure out how to correctly do the things that your application needs to do.

I suggest starting off with:
  • The Secret Life of JSPs
  • The Front Man

  •  
    reply
      Bookmark Topic Watch Topic
    • New Topic