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

calling a webpage at the click of a button  RSS feed

 
meenakshi venkateswaran
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
 
Eric Pascarello
author
Rancher
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
Rancher
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!