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

Catch the javascript button pressed event

 
Jeff Dube
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
How can i call the "<%@ include file="Response.jsp" %>" when my javascript button is pressed?
(This button have to call a page that insert new html code under the old one.)
Thanks
Jeff
 
Arsin Delve
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I can help you (I'm pretty good with Javascript) but I don't understand the question very well. Can you elaborate, and then I will try to be of some assistance?
Arsin Delve.
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff:
You cannot call the "<%@ include file="Response.jsp" %>" by pressing any button.
This is a JSP directive that allows files to be included in a JSP before the page is translated into a servlet.
That was a really weird question, BTW... I suggest you take some time to study the problem domain that Java Servlets and JSPs address.
My US $200.00
 
Jeff Dube
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thank you,
Here is my problem.
I do have a form (inside a table) that allow a user to enter some informations. After the information is enter, the user have two choices
1) Press the button to add a new row (under the previous row), this row contains 3 text area (<tr><td>..<form>..</td></tr> )
2) submitt the form.
Why do i need to add a new row? --> because the user may need 1 or multiple row to enter 1 or more value.
Briefly, the thing i need to do is insert a new row inside my table when the user click the button "insert a new row". I thought that making a jsp file with the <tr><td><form>...</td></tr> tags could be a good idea but it seems like.... it's not. Can anybody give me a tip or any other solutions???
Thank you
Jeff
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have basically 2 choices.
1. Capture the current form data and resend the page with a larger input area. Yuck.
2. Replace the HTML form with a Java Applet that has "grow" logic in it.
Your problem basically is due to the fact that HTML isn't designed to support partial updating of a page. About the closest you could get would be to play strange and unportable games with frames or hidden areas.
The applet's about the cleanest solution, except of course that you'll probably have to convince the user to download and install a 5+ MB plug-in. Even had Microsoft not X'ed out Java, the JVMs "supported" by IE and Netscape don't have Swing in them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic