开发者

jQuery Validate no Hyphens

Hello I am using the jQuery Validation plugin to validate my HTML forms.

I have an input field that does no开发者_C百科t accept hyphens:

<label for="trackISRC"><span class="mandatory">*</span> Track ISRC:</label>
<input type="text" name="trackISRC" id="trackISRC" MAXLENGTH="12">

Now I have to find a way to make this field accept every type of character but NO hyphens using the jQuery validation plugin..

How can I do that?

This is an example of the jQuery validation plugin for rules:

$("#trackFile").rules("add", {
 accept: "mp3|WAV|MP3|wav"
});

Thanks!


The regexp for no hyphens:

"^[^\\-]*$"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜