• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling a JSP page  RSS feed

 
Tahir Ehsan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We want to save data into a database.
I know First case is correct.But not sure about second case.
First Case
<form method="post" action="abc.jsp">
then
<input type="submit">

Second Case
<form method="post">
then
<input type="Button" on Click="location.href='abc.jsp'">

Basically I am using onChange java script function in a form for drop down menu.
When I use first case,when onChange function is called,then it goes towards
abc.jsp page.
But when I use the second case,then only null goes to the database.
Can any one help me in this situation.What way can I use to overcome my problem.
I want to open the same form when onChange function is called and when click on button then abc.jsp should be called.
 
Vasudevan Badri
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Tahir.

Well in this case you canuse the onclick event of the button to call the JSP
page (abc.jsp)
i.e it would be something like

<input type=submit onclick()=window.location='abc.jsp'

And regards to the database are you setting session or are you returing a resultset. That portion is not very clear. But for the button try this.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!