Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

pass value from javascript to jsp  RSS feed

 
priya pillai
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I don't know much javascript.In my prog i am dyanamically creating select and text boxes using clone method.I want to pass te values from this to jsp page..my prog is

Creation of table with select and text boxes


My output look like
pono=101
podate=12+oct+2000
D9=1
refno=1001
model=auto
color=black
ord_qty=3
prod_yr=1998
prod_mth=2
model=honda
color=pink
ord_qty=2
prod_yr=1999
prod_mth=8
saveorder=Save+Order

Please anybody help me ..How to pass the above to jsp to store it in database using bean...i want to use loop to get all the model color qty p year and p month



[BSouther: Added UBB CODE tags]
[ October 18, 2007: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, please be sure to use UBB code tags when posting code to the forums. Please read this for more information. You can go back and add them to your post by editing the message.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Secondly, you cannot pass JavaScript values directly to JSP methods. Remeber that JSP executes on the server in order to render an HTML page to send to the client. By the time any JavaScript is executed on the client, the JSP has long since finished its job on the server. You will need to submit the value back to the server to operate on it in any way on the back end.

Perhaps this article might help clarify the life cycle of a JSP.
 
priya pillai
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you ,,,
Actually i understood about jsp serverside and scriplet browser side...but i want to pass values from the browser to database.

how can i do this...

my output is

output look like
pono=101
podate=12+oct+2000
D9=1
refno=1001
model=auto
color=black
ord_qty=3
prod_yr=1998
prod_mth=2
model=honda
color=pink
ord_qty=2
prod_yr=1999
prod_mth=8
saveorder=Save+Order in the new window...

Actually i am using ejb i am getting values from the page using scriplet and i want to arrange them in some order(some collection to handle group of dates) and pass them...

please help.I google and i am not getting any idea.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I am missing something, can't you use hidden form fields?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!