Jul 5, 2001 #1 rabix Programmer Joined Apr 23, 2001 Messages 12 Location CH hi all, i got a jsp page with a check box in it. how can i check whether it is checked or not in another jsp page? rgds, Rabix
hi all, i got a jsp page with a check box in it. how can i check whether it is checked or not in another jsp page? rgds, Rabix
Jul 5, 2001 #2 manu0 Programmer Joined Apr 28, 2001 Messages 54 hi use a "name" attribute in your html check box tag. assign it a value. then you can retrieve the value of the check box field using the "request" implicit variable. ex : jsp 1 <html-tag-for-a-check-box name="mycheckbox"> </...> jsp 2 <% if( request.getParameter("mycheckbox".equals("???" { // do something } else { // do other thing } %> manu0 Upvote 0 Downvote
hi use a "name" attribute in your html check box tag. assign it a value. then you can retrieve the value of the check box field using the "request" implicit variable. ex : jsp 1 <html-tag-for-a-check-box name="mycheckbox"> </...> jsp 2 <% if( request.getParameter("mycheckbox".equals("???" { // do something } else { // do other thing } %> manu0
Jul 10, 2001 #3 wushutwist Programmer Joined Aug 3, 2000 Messages 984 Location US Checkboxes submit a value only when they are checked. Example: HTML Code: <INPUT TYPE="CHECKBOX" NAME="cbox"> JSP Code: if (request.getParameter("cbox") != null && !request.getParameter("cbox").trim().equals("")) { /* Checkbox is checked */ } else { /* Checkbox is not checked */ } Hope that helps. Wushutwist Upvote 0 Downvote
Checkboxes submit a value only when they are checked. Example: HTML Code: <INPUT TYPE="CHECKBOX" NAME="cbox"> JSP Code: if (request.getParameter("cbox") != null && !request.getParameter("cbox").trim().equals("")) { /* Checkbox is checked */ } else { /* Checkbox is not checked */ } Hope that helps. Wushutwist