• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Problem with INPUT TYPE=button in JSP

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've found in cases like this, Mozilla and its JavaScript Console are my best friends.
hth,
bear
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic