Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display Result on Same Page?

 
Yogan Raj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I hit the submit button, the result are display on a new page. how do I force it to stay on the same page, here's my code.

 
Kathleen Angeles
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You 'submit'ted the form to the server.

HTTP is a stateless protocol.

When you submitted the form, you killed current state already. When the server replies, it replaces the 'entire' page. The previous page has gone to hell already.

Good for you, and all of us, there is Ajax. To work with it with less pain, use frameworks like jquery.

With ajax, you can use javascript to talk to your server (send AND receive data). With the data returned, use CSS, HTML, javascript, and tools like jquery UI, to update the part of the page you need to update; without affecting any other parts of the page.
 
Yogan Raj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kathleen Angeles wrote:You 'submit'ted the form to the server.

HTTP is a stateless protocol.

When you submitted the form, you killed current state already. When the server replies, it replaces the 'entire' page. The previous page has gone to hell already.

Good for you, and all of us, there is Ajax. To work with it with less pain, use frameworks like jquery.

With ajax, you can use javascript to talk to your server (send AND receive data). With the data returned, use CSS, HTML, javascript, and tools like jquery UI, to update the part of the page you need to update; without affecting any other parts of the page.


is there anyway you can fix it ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic