File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Wonderful Number in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Wonderful Number in jsp" Watch "Wonderful Number in jsp" New topic

Wonderful Number in jsp

YuenLian Wu
Ranch Hand

Joined: Nov 16, 2005
Posts: 73
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

Nimchi Yung
Ranch Hand

Joined: Jan 27, 2004
Posts: 71
Before you submit, you could use javascript to build up your contents
in your TD tags and submit it to the server.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63862

Use a hidden input element.

[Asking smart questions] [About Bear] [Books by Bear]
YuenLian Wu
Ranch Hand

Joined: Nov 16, 2005
Posts: 73
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

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
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.

I agree. Here's the link:
subject: Wonderful Number in jsp
It's not a secret anymore!