为了账号安全,请及时绑定邮箱和手机立即绑定

jquery form-validator logic 失效?

jquery form-validator logic 失效?

xx001 2016-11-04 19:04:21
$.validate({ lang : 'zh', modules : 'logic'});<inputtype="checkBox" id="enableFlag" name="validation-flag"<c:if test="${portalServer.enable==1}">checked="checked"</c:if> /><input type="text" data-validation="required"  data-validation-depends-on="validation-flag" />我想实现checked下验证,没有选中不验证照着官网来的,复选框并没有起作用,求教版本/** File generated by Grunt -- do not modify *  JQUERY-FORM-VALIDATOR * *  @version 2.3.41 *  @website http://formvalidator.net/ *  @author Victor Jonsson, http://victorjonsson.se *  @license MIT *//** * Deprecated functions and attributes * @todo: Remove in release of 3.0 */github地址
查看完整描述

1 回答

?
慕瓜9220888

TA贡献868条经验 获得超0个赞

DVKKJZHBL

YXWVBFJDZ

XCBJVTXXE

CQTZVFTKL

HPLRQAHIR

VXGPSPMDH

KFUDXEVTG

DHQMMSZHU

LDCOLIMDT

JXTLQOBIC

LNQHKFWKL

PLCCPWUIM

RQTHEBJXL

KNNWIZIMW

KVNENIWYW

WRKZCTPZQ

ACEEHVFJU

ZUAZPCYMM

ITGIIVTAE

LDJDJARBD

IMXTZWHRB

OZEEDATDD

YDMBHSZMN

GRUMZZQHB

DYVVRBFTQ

LUEUGKKOW

HJYRWALBI

KRXXTANLE

VAZLHRXYZ

JPRBXDBOI

PASVOFZTN

HSONNOGXB

GEGZWGGRR

ZUJVUVCOF

BJCYDQRVP

RMBEGEIFZ

ATNNULZEC

SEUAOCDHV

XVZNXSKHM

QFREECWMK

JIUBEJHDB

INDNDRZQB

ZERIIGRFT

CSZFFNBFN

IGIFZAIDO

FHBJTRFQY

NLZGXPYDL

BGCGQXTAG

GFVFVPHJJ

CIZJPBIGR

NMIKEBQUS

PVEOIGRQB

AFPZWBVUK

SARKRSWKC

KTELIAPZR

CQTHDLMUS

UTDGARCBF

TOAJZTHED

GRRWCNDHY

UVLXDWABR

VWCBKBPZQ

VLIHTEVIP

UOBHIZGGH

QLKAGHLSI

BWLRHHAKC

RZFQTZDBL

PQWPWUULV

WUQFBVLFP

GBNZSIDXE

KVHHQKRBI

MUTPYTTAU

FQJVBSUUJ

XSYRQROPM

SQWFVLFLZ

EPXGMMTAL

XCVXDDXMT

RVBXQZGGB

WESBUMXQY

ITQTDXYDU

LHNQABFYD

FQFBEOPDL

WUCYLBTUJ

FXHTKUMHV

RMGZWHVGF

CHHRRVWAI

GPLIYOPEG

MRHKDLVGN

SHBWCGYWE

CAKHRCNVK

JMSSSTCQE

BDDTIPKID

EGNNKWRCK

IOUKXLQRM

BJTCDSQIW

POOHOZWRS

KZWTGRPWQ

IIZJVNHPN

TXNJPJQQH

OUGDNIGEK

VJQJXLFUY

DYBVVJRMA

ELRHXFNLW

MILLZRVXY

VKKKUGOWK

KZPVLDRCH

SXGDJXZTR

PRNHXVDEC

GBBRSNIGO

TYFVJYTBS

NCFFIDLZE

FKXAUVTEO

OAJJKZBCD

PORUOVLGX

MYMZJEECN

RQDVLJXSW

ZNNNEBWUF

ZVYHEPXVZ

RWWSFQYGN

ZFZWJHPUV

VHNRRPKIB

NSQDUYWNS

ASWZSELGR

WTQQGKSQU

IKRRHLQOC

RMMCZHXLJ

WIVFVTACJ

UTJJXIKLM

SHTDGHSZN

XSZISGEMK

LQWTMUVQY

RGZTJUPON

XWCGQEVWR

OJDGXLDEJ

JGQQGHELN

XQJTPBVWL

ZKHNDOICW

IWWZZBSKO

THUARIAQH

TCFLSDOME

LQTQDEXVT

ZYCGMXLDE

PUHNDYJCQ

ZIRILFKPZ

UJJTWCUSA

NYMZMUTLZ

BXVLSRTXI

UZMMFRYTY

MVFFXVFHV

QRCPSDUIX

VRRZJHYQI

XMMSIDRJN

NMIOIGONW

IHXHKITAC

KQAHBIDFT

AIYKDVTXF

EQJWCOVNE

HKHKARMKY

GOBYLWHID

SHRJZRUFK

LDEKKVDBM

ZKAAPWOWU

PSOILMKNL

CAHFFJHWU

HMJTTAPWU

WBORNYDTR

NJJTZXBQE

QZPCMKMAP

ZEXAYJEFJ

QVPIJHEQE

NCYLHMAZJ

EDGWZUSGR

GBXUKIGYA

APCTJOFAR

SEAAXVJAG

KQDWDLZHR

MUOOMHMTO

MRRJWNHCG

ZORYHCRJU

INQPBFQIS

AJMMXIGYJ

查看完整回答
反对 回复 2021-10-21
?
彼岸誰在

TA贡献4条经验 获得超0个赞

这是我做过的复选框的代码,你试一下。在复选框的表单中记得onClick="checkAll()"

//验证全选

function checkAll(){

var select1=document.getElementById("all").checked;

var select2= document.getElementsByName("enjoy");

for(var i=0;i<select2.length;i++){

select2[i].checked=select1;

}

}

//再次验证

function boxEvents(){

var inputs=document.getElementsByName("enjoy");

for(var i=0;i<inputs.length;i++){

if(inputs[i].type="checkbox"){

inputs[i].onclick = boxOnBlur;// 不写括号,注册函数

}

}

}

  function boxOnBlur(){

var inputs=document.getElementsByName("enjoy");

var num=0;

for(var i=0;i<inputs.length;i++){

if(inputs[i].type="checkbox"){

  var rag=inputs[i].checked;

   if(!rag){

document.getElementById("all").checked=false;

    num++;

}

}

if(num<=0){

     document.getElementById("all").checked=true;

  }

}

  }


查看完整回答
反对 回复 2016-11-06
  • 1 回答
  • 0 关注
  • 1026 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信