• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Display Result on Same Page?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
reply
    Bookmark Topic Watch Topic
  • New Topic