Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Wonderful Number in jsp

 
YuenLian Wu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am having problem using jsp with javascript. Actually I have a text inside the HTML TAG, like <TD height="27">1</TD>, the "1" indicating the sequence number, and I want to pass it to server without using any textfield, combo box, etc. My form is kind of dynamic , which means the next row may be 2, or 4 since user can remove any row dynamicly. How can the server side retrieve this wonderful number ?

Please help

Transistor
 
Nimchi Yung
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before you submit, you could use javascript to build up your contents
in your TD tags and submit it to the server.

--Nimchi
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a hidden input element.
 
YuenLian Wu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't simply use the hidden tag, since the server side won't that value belong to which row in my form. Also, hidden tag can't pass in an array form into server, so that all the rows in my form won't be recognize by the processing mechanism from the server

Transistor
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hidden tag can't pass in an array form into server...Very good

That is why you need to develop something that takes the array and makes in a format tat can be passed to the server. Bears idea would have a hidden field in each row that you would update with the new position. Or you take the array, make it into a string and put that value in the hidden element.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic