JSP: Comment soummetre un bouton radio

Author:
       
//File: index.html

    
        Exemple de bouton Radio
    
 
    
        

Submitting Radio Buttons

                                    Radio Button 1             
                          Radio Button 2             
                          Radio Button 3             
                           //File: formAction.jsp              Reading Radio Buttons                   

Reading Radio Buttons

        <%             if(request.getParameter("radios") != null) {                 if(request.getParameter("radios").equals("radio1")) {                     out.println("Radio button 1 was selected.
");                 }                 else {                     out.println("Radio button 1 was not selected.
");                 }                 if(request.getParameter("radios").equals("radio2")) {                     out.println("Radio button 2 was selected.
");                 }                 else {                     out.println("Radio button 2 was not selected.
");                 }                 if(request.getParameter("radios").equals("radio3")) {                     out.println("Radio button 3 was selected.
");                 }                 else {                     out.println("Radio button 3 was not selected.
");                 }             }         %>                         

Leave a Reply

Your email address will not be published. Required fields are marked *