Form and radio issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chicago1985
    New Member
    • Oct 2007
    • 9

    #1

    Form and radio issue

    How do I keep Radio button values and not lose them after a Form is submitted? I have no problem keeping text values where a form is submitted and if there is a validation issue with the text value it takes me back to the Form and shows the Form text value that was submitted. With Radio buttons it clears the Form Radio selection.

    JavaBean:
    Code:
    public void setNotify(String n) {
        notify=n;
      }
     public String getNotify() {
        return notify;
      }

    Form in JSP:
    Code:
    <jsp:useBean id="formHandler" class="Concord.FormBean" scope="request"/>
     
    <form action="process.jsp" method=post>
    ....
    Yes <input type="radio" name="notify" value="Yes" <jsp:getProperty name="formHandler" property="notify" /> >   <br>      
    No <input type="radio" name="notify" value="No"  <jsp:getProperty name="formHandler" property="notify" /> >
    Please advise.
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by chicago1985
    How do I keep Radio button values and not lose them after a Form is submitted? I have no problem keeping text values where a form is submitted and if there is a validation issue with the text value it takes me back to the Form and shows the Form text value that was submitted. With Radio buttons it clears the Form Radio selection.

    JavaBean:
    Code:
    public void setNotify(String n) {
        notify=n;
      }
     public String getNotify() {
        return notify;
      }

    Form in JSP:
    Code:
    <jsp:useBean id="formHandler" class="Concord.FormBean" scope="request"/>
     
    <form action="process.jsp" method=post>
    ....
    Yes <input type="radio" name="notify" value="Yes" <jsp:getProperty name="formHandler" property="notify" /> >   <br>      
    No <input type="radio" name="notify" value="No"  <jsp:getProperty name="formHandler" property="notify" /> >
    Please advise.
    Where you are doing validation?
    I mean at server Side or at Client Side?
    If that is at Server Side and you want to back to the form if validation fails then you can achieve it using Cookie.
    If that is at Client Side then I think no question of clear selection.

    Debasis

    Comment

    Working...