i am creating my web site using jsp. the problem that is faced is when i click submit button after execute my page, it will return to wrong page. however i already type return to the relevant page in my program. how to make sure that after click submit button, my page will return to the relevant page. my program is using frame. Firstly, i select option from the list bar. after select, it will execute my program. unfortunately after execute it returned to the wrong page
Sorry Can't understand your problem. Please post some code. you specify action in form tag and clicking on submit it goes to the specified action. <form action="/myjsp.jsp" method="POST"> //form elements here </form>
I'm still not really clear on what you are trying to do...
I don't see a SUBMIT button anywhere in your form...
All the code looks like it does is query a database based on the value of the request parameter named "prop", but nothing is done with the results of the database query.
The session parameter named "database" gets set to either "klcv" or "sv" depending on the value of the "prop" request parameter, but then it is set to "brv" no matter what at the end of the scriptlet.
Your form, if it ever could be submitted, sends a POST request to page1.jsp, however, you also have a META "refresh" on the page that sends a GET request to page1.jsp after 2 seconds.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Feb 17, 2004
The submit button is created at other page. Not the same page with the code that i provided. Below are part coding of submit button page:<form name="form1" method="post" action="select_2_property.jsp" onSubmit="return chk();"> <table border="0"> <tr><td><font color="#0929AF"><strong>Online Registration</strong></font></td></tr> <tr><td>Select Property That You Are Interested</td></tr> <tr><td> <select name="prop"> <option value="done" selected="selected">----- Select -----</option--> <option value="klcv">Kuala Lumpur Cityview</option> <option value="sv">Sentul View</option> </select> <input class="submit" type="submit" name="submit" value="Submit"> </td></tr> </table> </form>
Joined: Mar 18, 2004
Hi jil shi, I have used the following tag, its working fine at my side. <META http-equiv="refresh" content="2; URL=/jsp2.jsp">
Joined: Feb 17, 2004
i knw this code is working fine. when i add list bar to the program, it return to the wrong page. that was the problem