• 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

Wonderful Number in jsp

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67747
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
Use a hidden input element.
 
YuenLian Wu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic