File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Catch  the javascript button pressed event Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Catch  the javascript button pressed event" Watch "Catch  the javascript button pressed event" New topic

Catch the javascript button pressed event

Jeff Dube
Ranch Hand

Joined: Jun 14, 2001
Posts: 44
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.)
Arsin Delve

Joined: Jul 08, 2001
Posts: 29
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

Joined: Jan 30, 2000
Posts: 3226
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

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Jeff Dube
Ranch Hand

Joined: Jun 14, 2001
Posts: 44
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Catch the javascript button pressed event
It's not a secret anymore!