Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery验证插件-“;lettersonly";功能_Jquery_Validation_Plugins_Letters - Fatal编程技术网

jQuery验证插件-“;lettersonly";功能

jQuery验证插件-“;lettersonly";功能,jquery,validation,plugins,letters,Jquery,Validation,Plugins,Letters,我对jQuery还很陌生,我正在尝试将lettersonly函数用于我的注册表单。我已经看过了,但实施它似乎对我不起作用 这是我的密码: <form class="kennzeichen-input-big" action="step1.php"> <input type="text" name="kuerzel" id="kuerzel" style="font-size:50px;" maxlength="3" req

我对jQuery还很陌生,我正在尝试将lettersonly函数用于我的注册表单。我已经看过了,但实施它似乎对我不起作用

这是我的密码:

            <form class="kennzeichen-input-big" action="step1.php">
                <input type="text" name="kuerzel" id="kuerzel" style="font-size:50px;" maxlength="3" required> 
                <input type="submit" value="Zur Reservierung" class="btn signup" style="width:auto; margin-top:15px; margin-left:20px;">


</form>

    <script>
        $("form").validate(
        { rules: { ('#kuerzel'): { lettersonly: true } } }
        );
    </script>

$(“表格”)。验证(
{规则:{('kuerzel'):{lettersonly:true}}}
);

我假设问题出在“
myField
”标记上?我试过几件事,但都没成功。我也包含了其他函数。

您所缺少的是,该字段必须由Validate调用中的name属性引用

    $("form").validate(
    { rules: { ('#kuerzel'): { lettersonly: true } } }
    );
变成:

    $("form").validate(
    { rules: { kuerzel: { lettersonly: true } } }
    );

就是这样,假设您在页面上没有看到任何其他错误…

您所缺少的是字段必须由Validate调用中的name属性引用

    $("form").validate(
    { rules: { ('#kuerzel'): { lettersonly: true } } }
    );
变成:

    $("form").validate(
    { rules: { kuerzel: { lettersonly: true } } }
    );

就这样,假设您在页面上没有看到任何其他错误…

您好,谢谢您的回复。我试过了,但没用。我没有看到任何其他问题,一般的“必要”评论也有效。从给出的信息很难判断出什么是错误的,因为它在这里有效:页面上可能有其他表单?验证规则被附加到了错误的表单上?页面上只有一个表单,我现在很困惑,但我会继续尝试。感谢您目前的帮助。您使用的jQuery脚本是什么?其他方法不起作用:我有一个类似的问题。我的示例项目您好,谢谢您的回复。我试过了,但没用。我没有看到任何其他问题,一般的“必要”评论也有效。从给出的信息很难判断出什么是错误的,因为它在这里有效:页面上可能有其他表单?验证规则被附加到了错误的表单上?页面上只有一个表单,我现在很困惑,但我会继续尝试。感谢您目前的帮助。您使用的jQuery脚本是什么?其他方法不起作用:我有一个类似的问题。我的示例项目