commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jinli Cao <Jinli....@exigenservices.com>
Subject [validator] How to do when I have a issue that there are some inputs at my form in JSP, they are displayed or not is depened on a dropdown list. In this case, If I config all input properties in my validation.xml as one form, the component will check all.
Date Thu, 31 Mar 2011 04:37:36 GMT
But I don't want to process like that.
Please look at my one part of javascript  in my JSP.


<script language="javascript" type="text/javascript">
      function changeDiv(){
            var   name   =document.getElementById("paymentType").selectedIndex;
            var cc=document.getElementById("creditCardDiv");
            var eft=document.getElementById("eftDiv");
            if(name=="0"){
                  document.getElementById("creditCardDiv").style.display="block";
                  document.getElementById("eftDiv").style.display="none";
             }
            else if(name=="1"){
                  document.getElementById("creditCardDiv").style.display="none";
                document.getElementById("eftDiv").style.display="block";
             }
}
</script>
<form:select path="paymentMethod" onchange="changeDiv()" id="paymentType" >
                                                                                   <form:options
items="${paymentMethods}" />
</form:select>


There two DIVs in my page(creditCardDiv, eftDiv), It is good if when choose CreditCardDiv,
the validation to efvDiv disabled.
Please help me.


Regards.
Jinli.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message