Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with INPUT TYPE=button in JSP

 
Lon Allen
Ranch Hand
Posts: 67
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Lon Allen
Ranch Hand
Posts: 67
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found in cases like this, Mozilla and its JavaScript Console are my best friends.
hth,
bear
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic