aspose file tools*
The moose likes JSP and the fly likes Problem with INPUT TYPE=button in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with INPUT TYPE=button in JSP" Watch "Problem with INPUT TYPE=button in JSP" New topic
Author

Problem with INPUT TYPE=button in JSP

Lon Allen
Ranch Hand

Joined: May 24, 2001
Posts: 67
I have a JSP that contains a table within a form <FORM method="get"> and there is an INPUT type=submit that submits the data in the table fields to a java bean. What I am having trouble with is that I also want an INPUT TYPE=button within the table to allow me to open a new window to be able to control the formatting of data that gets edited into a specific field in the table. I cannot get the INPUT TYPE=button to do anything. I have tried calling a JAVASCRIPT function in the onClick property of the INPUT and have tried using the window.open(), but to no avail.
Any ideas on what I need to do to get the <INPUT TYPE=button ...> to work inside a FORM that already has a button defined to perform a method="get"?

Lon Allen
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

So what happens when you use the onClick attribute of the button? I've had no problems getting a JavaScript function invoked in this way.
A simple test:

(as usual, remove the underscore)
You might also want to get this moved to the HTML forum... nothing to do with JSP really.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Lon Allen
Ranch Hand

Joined: May 24, 2001
Posts: 67
Thanks Bear. I tried just doing the alert('Hi') as you have in your example and that works. The problem must be something else.

Lon
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61426
    
  67

I've found in cases like this, Mozilla and its JavaScript Console are my best friends.
hth,
bear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with INPUT TYPE=button in JSP