On Wed, Nov 25, 2009 at 1:03 PM, Andre Polykanine <an...@arthaelon.net> wrote:
> Hello brian and all,
>
> I was attempting to validate the form manually and had deep problems
> with it.
> Now I'm using jQuery.validate plugin and almost everything goes OK,
> but I still have a couple of missunderstandings:
> 1. How can I tell the plugin that a valid login (#ulogin) is a login that fits
> to a regexp or, say, just doesn't contain whitespaces?

Have a look at this:

http://stackoverflow.com/questions/280759/jquery-validate-how-to-add-a-rule-for-regular-expression-validation


> 2. For some reason I can't make the plugin validate a group of
> radiobuttons (gender selection) that is required. I'm using
> $("#signup").validate( {
> rules: {
> ...
> usex1: "required",
> ...
>                  }
>                  });
>                  ...
> <fieldset id="ugender">
> <legend>Select your gender:</legend>
> <input type="radio" name="usex" id="usex1" value=1>Male<br>
> <input type="radio" name="usex" id="usex2" value=2>Female
> </fieldset>
> What am I doing wrong? I tried to validate #ugender but it didn't
> help, either.


For the rules, the key is the name attribute of the element. You're
using the ID of one of the radio buttons. Try:

usex: "required",

Reply via email to