dptsivmg82908 2012-05-05 18:36
浏览 266
已采纳

如何正确使用jQuery.validity

Yesterday, I started here asking a question about my own project, and when I saw how helpful the people are and how fast they answered, I was really happy. My father is making a project by himself, and he asked me to write a question here for him because of English knowledge matters.

Well, he is trying to validate a form using jQuery.validity ( http://validity.thatscaptaintoyou.com ), but his function of validation is not working. Here is his code: http://pastebin.com/uvXRTZsE

I'm sorry for not pasting it here, but after several tries, parts of the code were missing when pasting them here.

  • 写回答

2条回答 默认 最新

  • douweng3383 2012-05-05 18:46
    关注

    There are two main problems that I see here:

    The id's on the input elements are not unique.

    As per the spec, an id on any element on a page must be unique. In other words, you shouldn't use id="organizacion" 4 times like you are. This may or may not affect the ability for scripts to locate your elements, considering they'll likely stop at the first one, being implemented with the knowledge and understanding that id's must be unique.

    Validity doesn't have any documentation supporting radio button validation.

    I don't see any text fields in your HTML, and I don't see any documentation in Validity in regards to radio buttons. Thus, what you're trying to accomplish may not be possible with Validity.

    As a final point, radio buttons are designed so that, in a group, one must always be selected. It's not possible to de-select a radio button. Thus, you should be sure that a default radio button is selected.

    This may of course eliminate the need to make this a required field, since by default an option is already selected.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题