• 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

onClick button and JSP

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all of you,
Tell me if it's possible to do this...
I want when a button is pressed to validate the information with JavaScript THEN...AND PERHAPS i need to include a JSP file or HTML file with this operation, it would look like this.
...........................................................
<INPUT TYPE="button" VALUE=" Add a row." ONCLICK="return addRow(this)">
------------------------------------------------*/
function addRow(objForm)
{
// inTheActualForm.open("extraRow.html");
// OR
<jsp:include page="extraRow.html">
</jsp:include>
return false;
}
// End of addRow().
..............................................................
I sure hope i make it clear enough for you, tell me please how i could manage such an inclusion.
Thanks kindly.
MC (*_*)
 
Bartender
Posts: 21753
148
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript in a web page runs on the client's machine - it can't directly talk to the JSP server. What you want to do is make the onClick() method do a submit and supply the URL of the JSP as the target.
 
mc moisan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim,
Perhaps I'm not sure how to do what you suggest me to do.
I'm new with JavaScript and JSP, so could you please be more descriptive on how i should submit and activate the URL.
Thanks again for you time.
MC (*_*)
 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is an example. Do something similar.
<FORM NAME = "yourformName" ACTION=" the URL of your JSP METHOD="POST">
In the onClick() event of your button, hace it submit your form.
ex yourformName.submit()

Bosun
 
mc moisan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you kindly Bosun,
You were of great help, have a great day !!!
MC (*_*)
 
mc moisan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem still !!!
I did what Bosun suggested PERHAPS it always open in another window, i wish to get it open in the actual form which contains a table... is that possible ??? if so, please help.
I tried the ...this.open(URL) /and many other possibilities,
but nothing works as i want it to. !!!
Thanks for your time all
MC (*_*)
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!