Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Modifying JavaScript .validate options.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bradley Moore (orangexception)  
View profile  
 More options Dec 15 2011, 11:24 am
From: "Bradley Moore (orangexception)" <orangexcept...@gmail.com>
Date: Thu, 15 Dec 2011 08:24:40 -0800 (PST)
Local: Thurs, Dec 15 2011 11:24 am
Subject: Modifying JavaScript .validate options.
I'm wanting to throw errors in a different place than standard. The
jQuery Validate plugin lets you do this by using "errorPlacement"
option.

The ValidateThis script uses {ignore:'.ignore'} by default. Is there a
way through the ValidateThis to override/set the jQuery Validate
options?

Here's what I'm doing now, but it'd be nice to do this an easier way.
```
#getColdboxOCM().get( "ValidateThis" ).getValidationScript(
        objectType=     "form/json" ,
        formName=       rc.form.name ).ReplaceAll(
                "ignore:'\.ignore'" ,
                '"ignore":                    ".ignore" ,
                        "errorPlacement":     function\( error , element \) \{
                                console.log\( "errorPlacement" \);
                                error.appendTo\( \$\( "##error-placement-target" \) \);
                        \} ,
                "debug":                      "true"
                ' )#
```


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Whish  
View profile  
 More options Dec 15 2011, 11:32 am
From: John Whish <john.wh...@googlemail.com>
Date: Thu, 15 Dec 2011 16:32:54 +0000
Local: Thurs, Dec 15 2011 11:32 am
Subject: Re: [ValidateThis] Modifying JavaScript .validate options.
You should be able to just set the defaults in a seperate script block.

Here's one I've used before:

<script type="text/javascript">
jQuery(function($) {
        jQuery.validator.setDefaults({
                errorClass: 'field-error-message',
                validClass: 'field-isvalid',
                errorElement: 'label'
        });

});

</script>

On 15 December 2011 16:24, Bradley Moore (orangexception)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bradley Moore (orangexception)  
View profile  
 More options Dec 15 2011, 2:01 pm
From: "Bradley Moore (orangexception)" <orangexcept...@gmail.com>
Date: Thu, 15 Dec 2011 11:01:17 -0800 (PST)
Local: Thurs, Dec 15 2011 2:01 pm
Subject: Re: Modifying JavaScript .validate options.
That's fantastic. Thanks.

On Dec 15, 10:32 am, John Whish <john.wh...@googlemail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »