<HTML>
<script>
      function disp(i){
            if(document.frm1.ch1[i].checked){
                  document.frm1.h1[i].value="Y";
            }
            else{
                  document.frm1.h1[i].value="N";
            }
      }
</script>
<%
      String v[] = request.getParameterValues("h1");

      for(int i=0;i<3;i++){
            if (v[i]==null || v[i].equals("")){
                  v[i]="~";
            }
            out.println(v[i]);
      }
%>

<BODY>
<form name=frm1 method=post action="ch1.jsp">
<input type=checkbox name=ch1 checked onclick="disp(0)">
<input type=hidden name=h1 value="Y">
<input type=checkbox name=ch1 checked onclick="disp(1)">
<input type=hidden name=h1 value="Y">
<input type=checkbox name=ch1 checked onclick="disp(2)">
<input type=hidden name=h1 value="Y">
<input type=submit name=s1 value="Submit">
</form>
</BODY>
</HTML>

i hope it will help u
Regards
Vaishali
Reliance Ind Ltd
Ahmedabad



                      Shamshad Alam
                      <[EMAIL PROTECTED]        To:       [EMAIL PROTECTED]
                      .IN>                     cc:
                      Sent by: A               Subject:  Reading Check Boxes
                      mailing list
                      about Java Server
                      Pages
                      specification and
                      reference
                      <JSP-INTEREST@JAV
                      A.SUN.COM>


                      07/07/02 11:10 PM
                      Please respond to
                      A mailing list
                      about Java Server
                      Pages
                      specification and
                      reference






Dear All Hi-Tech-Minds
I am using 3 checkboxes in an HTML form and initially all are checked with
values "Y". A JSP page reads these values by using
' String Array[] = rquest.getParameterValues("Checks") '
When all the checkboxes are checked the array contains 3 elements whose
values are all "Y" .. But if any of the checkboxes in any order is
UNCHECHED the array contains only those values which are checked and no
value at all for the unchecked one. Is there any way to capture a
different value of unchecked boxes in the same array?
Looking forward to get your help.
Thank you.
--Shamshad Alam



---------------------------------------------
This message was sent using Endymion MailMan.
http://www.endymion.com/products/mailman/

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to