首页 \ 问答 \ jquery验证或验证(jquery validate either or with validate)

jquery验证或验证(jquery validate either or with validate)

我正在使用http://bassistance.de/jquery-plugins/jquery-plugin-validation/插件和我需要修复的下面的伪块:

jQuery("#SearchForm").validate({
    rules: {
        Company: "required",
        CompanyName: {
      regex: "[a-zA-Z]*",
      required: true,
      minlength: 2
    } 
    },
    messages: {
        Company: "Type required.",
        CompanyName: "Only A-Z Allowed in the name."
    },
    errorPlacement: function(error, element) {
        error.appendTo('#JsErrorMsg');
    }
}); 

基本上我有1个输入类型的文本和1个选择,我想验证是否可以使用,但至少使用1,如果使用文本框,它应该只接受字符来搜索名称字段,其他选择列表是公司ID的1-x列表。 我希望在增长我自己的产品并使用它使用的相同样式之前,建立此插件(如果存在)。 如果这个库不能做到这一点似乎很奇怪。

感谢你的帮助,欢呼


I am using the http://bassistance.de/jquery-plugins/jquery-plugin-validation/ plug in with the follow pseudo block that I need to fix:

jQuery("#SearchForm").validate({
    rules: {
        Company: "required",
        CompanyName: {
      regex: "[a-zA-Z]*",
      required: true,
      minlength: 2
    } 
    },
    messages: {
        Company: "Type required.",
        CompanyName: "Only A-Z Allowed in the name."
    },
    errorPlacement: function(error, element) {
        error.appendTo('#JsErrorMsg');
    }
}); 

basically I have 1 input type text and 1 select, I want to validate that either or can be used, but at least 1 must be used, if the text box is used, it should only accept characters to search on a name field, the other select list is a 1-x list of company ids. I am hoping to build off this plug in, if it exists, before growing my own and using the same styles it uses. it would seem odd if this library can not do this.

thank you for your help, cheers


原文:https://stackoverflow.com/questions/9627615
更新时间:2023-07-10 20:07

相关问答

更多
  • 不,他们没有限制。 仅限开发人员帐户中的100 iOS设备。 您可以通过从Keychain访问导出将开发和分发证书用于其他Mac。 它将作为身份验证的密码。 No their is no limit for that. limit only for 100 iOS Device in Developer account. You can use Development and Distribution certificate to other Mac by Exporting from Keychain a ...
  • 这取决于您希望对项目的参与程度。 为了管理应用程序的完整开发生命周期,您需要创建配置文件,生成用于分发的证书,生成应用程序ID等。 您可以将开发人员添加为成员,但在这种情况下,许多这些功能必须由您作为管理员完成。 在证书(用于分发,推送通知等)的情况下,“成员”可以请求它们,但它们仍然需要被“管理员”批准。 因此,如果您希望给予最少量的权限,请坚持使用'成员选项,并了解您需要定期参与。 It depends on what level of involvement you want to have with ...
  • 在最后一次提示后,我建议你尝试以下方法: 在Apple的会员中心,转到“证书,标识符和配置文件”,然后在“iOS应用程序”下选择“设备” 确保列出您的设备。 转到“配置配置文件” - >“分发”部分,单击Ad-Hoc配置文件,然后单击“编辑”。 在“证书”部分中,确保选中分发证书。 在“设备”部分中,确保已选中您的设备。 单击“生成”,重新下载并重新构建。 祝好运。 Following the last hint, I would suggest you try the following: In Appl ...
  • 是的,在上面的xcode 7中,没有选择导出ipa。 但我们可以通过其他方式生成iPa文件。 请按照以下步骤操作: 选择产品 - >存档选项 右键单击WifiList并选择Show in Finder 它将打开文件夹,然后右键单击文件夹选项“ 显示包内容 ” 现在你可以存档然后你可以拖放iTunes。 拖放桌面。 我希望,它会对你有所帮助。 Yes, In xcode 7 above there is no opting for export ipa. But we can do some other wa ...
  • 我很遗憾地说,如果您创建了两个帐户并且想要使用一个帐户进行测试而另一个帐户用于发布,则需要支付2个年费,并且几乎没有空间解决这个问题。 现在,就你的选择而言,你可以选择其中一种方式。 创建两个开发者帐户,每年支付200美元。 考虑使用一个帐户进行测试和发布。 我不知道你这样做的顾虑是什么,但这样做是完全可以接受的。 您现在使用个人帐户测试您的应用程序,假设您甚至使用此帐户来发布您的应用程序。 在任何时候,Apple都有一个法律实体变更流程(我已经完成并且实际上并没有那么糟糕)将您的帐户从个人帐户迁移到公司帐 ...
  • 您想要做什么需要企业开发人员许可证。 在此处了解更多信息: Apple Enterprise Program 但是,如果您在网站上使用此程序或任何其他方式分发您的应用程序,则您违反了Apples服务条款。 这意味着他们可以随时撤销您的签名证书。 您最好的选择是支付正常的开发人员许可证并开始使用Testflight。 我知道这不是你想要做的,但老实说,你必须尊重Apple所创造的服务条款,否则当Apple关闭你时你就没有法律追索权。 你为什么需要使用Testflight? 使用除企业许可证以外的配置文件进行代 ...
  • 在Xcode 8中,您现在可以将Xcode设置为自动管理配置文件,通过选中“常规”选项卡中的框,这应该可以解决您可能遇到的任何配置文件问题。 If you have created the provisioning profile using user account i.e. you don't have an apple developer account, then you have to run the app using new bundle ID so that your old Id gets ...
  • 1:是的。 它将检查名称是否与信用卡上的名称相同。 2:你住在哪个国家? 1: Yes. It will check that the name is the same as on the credit card. 2: What country do you live in?
  • 您通常会在itunesconnect中看到您的下载编号,因此您可以邀请您的客户查看其中的数据。 还有许多Web服务使用来自itunesconnect的数据来显示更多详细信息,例如应用程序统计信息。 如果您想要更多数据甚至是日志记录,许多用户会在其应用程序中集成其他日志记录功能,例如谷歌分析。 如果这不是你想要的,请给我一些关于你想要完成的事情的更多信息! You usually see your download numbers in itunesconnect and therefore you can ...
  • 原因是在Mac中,一个钥匙串钥匙可以访问多个Apple证书。 应用程序开发证书和应用程序APNS证书共享相同的钥匙串密钥(.p12)。 但是,相同的钥匙串密钥(.p12)仅包含应用程序开发证书的信息。 您需要以pem格式打开钥匙串(.p12),并发现AWS SNS控制台意外地在钥匙串密钥(.p12)中自动加载应用程序开发证书,这将导致以下错误。 参数无效:属性原因:平台凭据无效(服务:AmazonSNS;状态代码:400;错误代码:InvalidParameter;请求ID:...........) 要将证 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)