• 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

JSP - Selfsubmiting help

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having a basic question, but not able to figure it out how. Appreciate your help greatly.

I ahev a JSP page with several bunch of fields and I also have a dropdown box and let call this as "Codes". When this jsp page first oaded user will enter few firlds. Based on that data I need to get the "Codes" dropdown box data from the server by submitingthe page. My questions is, When Submit the page how do I keep the data in the controls with out loosing the data when it reloads the JSP Page ? Is there any specific thing I need to do ? Also When the pAge first Loads I need to execute some branch of server side code and When it reloads (When the User clicks "ErrorCode" dropdown) then it should execute different set of servser side code ? How Can I do this ?

I geatly appreciate your help.

Thanks
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the value attributes of the elements to set their initial values to whatever they were when the page was submitted.

Or, you can avoid the whole problem by employing Ajax to do the submission behind the scenes.
 
Mike Vat
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. Can you please help me little more about it on how I should use VALUE attributes ?

Do you mean

<input type="text" value = ??? -> This attribute you are talking about ?

thanks very much for your reply.

thanks
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. You have the data that was submitted, so it's just a matter of putting it back into the value attributes.

For example:
 
Mike Vat
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks very much it is working.
reply
    Bookmark Topic Watch Topic
  • New Topic