0
点赞
收藏
分享

微信扫一扫

判断选中的多选钮后面跟的文本框的值可以必须要判断对错,否则不判断对错...


form:

String checkBox1 = null;

String checkBox2 = null;

for(int i=0;i<getChargeStatCheckBox().length;i++)
  {
      if(chargeStatCheckBox[i]!=null||!chargeStatCheckBox[i].equals(""))
    {
     if(chargeStatCheckBox[i].equals("chargeStat01"))
     {
      checkBox1 = "chargeStat01";
     }
     if(chargeStatCheckBox[i].equals("chargeStat02"))
     {
      checkBox2 = "chargeStat02";
     }
}

if(checkBox1!=null)
   {
    System.out.println("form========="+checkBox1);
    // 收费统计处罚开始
    if(chargeStatPunishmentBegin==null||"".equals(chargeStatPunishmentBegin))
    {
     System.out.println("form111111========="+checkBox1);
     errors.add("errorChargeStat",new ActionMessage("chargeStatPunishmentBegin.null")) ;
    }

   }

   if(checkBox2!=null)
   {
    // 收费统计处罚终止
    if(chargeStatPunishmentStop==null||"".equals(chargeStatPunishmentStop))
    {
     errors.add("errorChargeStat",new ActionMessage("chargeStatPunishmentStop.null")) ;
    }

   }



这样就实现了选中的多选框后边跟的文本框才去判断,否则不判断



黑色头发 http://heisetoufa.iteye.com


举报

相关推荐

0 条评论