jQuery validation depends

倾然丶 夕夏残阳落幕 提交于 2019-12-23 04:12:29

问题


Is it possible to add a depends onto an equalTo rule?

i.e.,

rule {   
    myFormFierld: if textbox name has been filled out add this equalTo rule..
}

回答1:


The answer is yes. You just need to declare it that way

billingAddress: {
  required:true,
  minlength:5
  equalTo: {
    param: "#shippingaddress",
    depends: "#compare:checked"
  }
}

Simple and beautiful. Via this ticket.



来源:https://stackoverflow.com/questions/5725584/jquery-validation-depends

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!