Take a look at the milk-demo: http://jquery.bassistance.de/validate/demo/milk/

It's errorPlacement-usage should be a good reference:

        // the errorPlacement has to take the table layout into account
        errorPlacement: function(error, element) {
                if ( element.is(":radio") )
                        error.appendTo( element.parent().next().next() );
                else if ( element.is(":checkbox") )
                        error.appendTo ( element.next() );
                else
                        error.appendTo( element.parent().next() );
        },

If that doesn't help, please upload a testpage and post the URL here.

Jörn

On Mon, Jun 23, 2008 at 11:56 PM, pixelyzed
<[EMAIL PROTECTED]> wrote:
>
> Hello Jörn,
>
> Thank you for your help earlier. I'll try to figure out custom methods
> later. Right now I'd like to know if it's possible to change the
> errorPlacement option for only one specific messgae. I'm trying to
> validate multiple checkbox and radiobuton groups and I have the
> default insertAfter going and it's exactly what I want for most
> fields. But those radiobutons and checkboxes are side by side with the
> label on the right and the error message is inserted right after the
> first radio or checkbox, pushing its label to the next line along with
> the others and it looks weird. So ,for those I'd prefer having the
> error message appear before.
>
> Is that possible and how? Here's my validation JS code so far:
>
> var loginValidator = $("#inscriptTalentProfessionnel").validate(
>  {
>  errorElement: "div",
>  onsubmit: true,
>  onfocusout: true,
>
>  messages: {
>    vfPrenom: "S.V.P. entrez votre prénom",
>    vfNom: "S.V.P. entrez l'adresse  de votre entreprise",
>    vfAdresse: "S.V.P. entrez votre adresse civique",
>    vfVille: "S.V.P. entrez le nom de votre ville",
>    vfProvince: "S.V.P. entrez le nom de votre province",
>    vfCode_postal: "S.V.P. entrez votre code postal",
>    vfTelephone:  "S.V.P. entrez votre numéro de téléphone",
>    vfCourriel: {
>      required: "S.V.P. entrez le courriel du contact",
>      email: "S.V.P. entrez une adresse de courriel valide"
>    },
>    vfSexe: "S.V.P. cochez la case correspondant à votre sexe",
>    vfDate_naissance: "S.V.P. entrez votre date de naissance",
>    vsfSecteur2: "S.V.P. choisissez au moins un secteur d'activité",
>    vfFamille_metier: "S.V.P. choisissez au moins une famille de
> métier",
>    typeCarteCredit: "S.V.P. Veuillez choisir un type de carte de
> crédit",
>    numeroCarte: {
>    required: "S.V.P. entrez votre numéro de carte de crédit",
>    creditcard: "S.V.P. entrez un numéro de carte de crédit valide
> valide"
>    }
>  }
> });
>
> Thanks again,
>
> Stéphane
>
> On Jun 23, 1:50 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> wrote:
>> I've changed the section title slightly, hopefully this makes it
>> easier to find 
>> them:http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation...
>>
>> Custom methods are added via 
>> $.validator.addMethod:http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemet...
>>
>> For inspriation, they are barely tested, a set of additional methods
>> to pick 
>> from:http://dev.jquery.com/view/trunk/plugins/validate/additional-methods.js
>> Test, and therefore sort-of documentation for all default and three
>> additional methods are 
>> here:http://dev.jquery.com/view/trunk/plugins/validate/test/methods.js
>>
>> Let me know when you need further help.
>>
>> Jörn
>> - Show quoted text -
>

Reply via email to