Forums Register Login

Retaining Radio Button Values After Refresh

+Pie Number of slices to send: Send
Hi,

I am trying to make a form that consists of several radio buttons. After clicking the submit button the result will be shown on the same page. I want to add this feature to my program so that after submitting the form and presenting the results, user can see his selected fields.

I have tried this code but it did not work.



"stat" is the name of my java package that I have called in this .jsp file and I have defined setcolor() and getcolor() in that java package.

Any suggestions or comments would be appreciated.
+Pie Number of slices to send: Send
Two things:
  • Java scriptlets have been discredited for 10 years now. You should be using the EL and JSTL.
  • In Java, strings are not compared with == but with the .equals() method.
  • If you are expressing colors as numbers (that's wierd to being with), why are you storing the numbers as strings?
  • +Pie Number of slices to send: Send
    Thank you for your response. I am very new to Servlets and JSPs development. Can you introduce a book or a good source that I can use?
    And with regards to colors and storing them as number, that was an example of what I am doing. In fact I am working on creating a calculator that its parameters should be entered via a form that consists of both textfields and radio buttons.
    +Pie Number of slices to send: Send
    Make sure whatever book or tutorial that you use is up-to-date and focuses on the JSTL and EL rather than Java scriptlets.

    If you are new to JSP and servlets, I also recommend reading these articles:
  • The Secret Life of JSPs
  • The Front Man

  • +Pie Number of slices to send: Send
    Thank you so much for your prompt response.
    I guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 2338 times.
    Similar Threads
    JSP Error
    Using EL to generate attribute/value pairs inside of an XHTML element
    How to get the hidden field from JSP
    Pass radio button to servlet
    setting a radio button
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 28, 2024 17:34:08.