Win a copy of Microservices in Action this week in the Web Services forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

calling a webpage at the click of a button  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can an onClick event on a button be used to call another jsp page? I have a submit button which submits a form and I want to call another webpage at the click of another button which is not a submit button. How can I do it?

Thanks in advance,
Meenakshi
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this what you are after?

<input type="button" name="btn1" value="open" onclick="document.location.href='page.html'">
 
meenakshi venkateswaran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also want to access some form values from the current page in the new page that I am calling. I do not want to use the submit button for this purpose. How do I do it?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
either you can submit the form with
onclick="document.formName.submit()"

or

you are going to have to create a function that adds values to a query string and canges the location.

Eric
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!