Okay, that won't work as focusInvalid gets the wrong state when called
via success-option.

Its not a great solution, but could work better: Replace
validator.focusInvalid with $("#fteste").valid();
That validates the whole form and should trigger focusInvalid with the
appropiate state.

Jörn

On Mon, May 19, 2008 at 6:18 PM, Alexsandro_xpt <[EMAIL PROTECTED]> wrote:
>
> Hi Jörn Zaefferer
>
> I'm again..
>
> Take a look
> http://blog.alexsandro.com.br/aa.htm
>
> I do it what you tell me but, It dont work, I dont know what more I
> do.
>
> validator.focusInvalid() like's, dont fire very well.
>
> What more do?
>
>
> Thanks in advance
>
>
> On 13 maio, 14:26, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> wrote:
>> Try this:
>>
>> var validator = $("#fteste").validate({
>>  rules:{
>>  T1:{ required: true, email:true },
>>  S1:{ required: true }
>>  }, messages:{
>>  T1: { required: "Enter a e-mail!", email: "Enter a valid e-mail!" },
>>  S1: { required: "Provide a <b>text</b>" }
>>  },
>>  errorPlacement:function(error, element){
>>  error.appendTo( $('<div style="display:none"></
>> div>').appendTo(element.parent("p")) );
>>  },
>>  success: function() {
>>    validator.focusInvalid();
>>    console.log(validator);
>>  }
>>
>> });
>> On Tue, May 13, 2008 at 2:47 PM, Alexsandro_xpt <[EMAIL PROTECTED]> wrote:
>>
>> >  Hi Jörn Zaefferer,
>>
>> >  I again!
>>
>> >  I Try like you tell me, but don't work. take a look.
>>
>> >  $("#fteste").validate({
>> >   rules:{
>> >   T1:{ required: true, email:true },
>> >   S1:{ required: true }
>> >   }, messages:{
>> >   T1: { required: "Enter a e-mail!", email: "Enter a valid e-mail!" },
>> >   S1: { required: "Provide a <b>text</b>" }
>> >   },
>> >   errorPlacement:function(error, element){
>> >   error.appendTo( $('<div style="display:none"></
>> >  div>').appendTo(element.parent("p")) );
>> >   },
>> >   success: function() {
>> >     $("#fteste").focusInvalid();
>> >     console.log(validator);
>> >   }
>> >  });
>>
>> >  And I tried put a console.log(validator); to trace sucess event but
>> >  event dont fire while enter valid e-mail on first input.
>>
>> >  Can you help me?
>>
>> >  Thz
>>
>> >  On 12 maio, 17:08, "Jörn Zaefferer" <[EMAIL PROTECTED]>
>> >  wrote:
>>
>> > > You could use the success-option, passing a callback, as a hook to
>> >  > trigger validator.focusInvalid(). Something like this:
>>
>> >  > var validator = $("...").validate({
>> >  >   // other options
>> >  >   ...,
>> >  >   success: function() {
>> >  >     validator.focusInvalid();
>> >  >   }
>>
>> >  > });
>>
>> >  > Jörn
>>
>> > > On Mon, May 12, 2008 at 5:23 PM, Alexsandro_xpt <[EMAIL PROTECTED]> 
>> > > wrote:
>>
>> >  > >  Hi Jörn Zaefferer,
>>
>> >  > >  I try to use your plugin in this way, take a look:
>> >  > >  http://blog.alexsandro.com.br/aa.htm
>>
>> >  > >  And I try any way to validate inputs on cascate.
>>
>> >  > >  Eg.:
>> >  > >  open this urlhttp://blog.alexsandro.com.br/aa.htmclickin submit.
>>
>> >  > >  Look!, the ballon start on first input, but if you enter a valid e-
>> >  > >  mail on input, the ideal is the ballon jumps on the last textarea
>> >  > >  input automatic.
>> >  > >  Did you know?
>>
>> >  > >  Did have idea to fix it to handle in this way behavior?
>>
>> >  > >  Thz!
>>
>> >  > >  On 12 maio, 08:31, "Jörn Zaefferer" <[EMAIL PROTECTED]>
>> >  > >  wrote:
>>
>> >  > > > A new release of the validation plugin
>> >  > >  > (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) is
>> >  > >  > done, now at version 1.3. This release adds five more localizations
>> >  > >  > and fixes a few bugs, eg. "asdf" is not a valid creditcard number
>> >  > >  > anymore.
>>
>> >  > >  > Major improvements went into validating a form without triggering 
>> > UI
>> >  > >  > feedback (http://dev.jquery.com/ticket/2215) and batch adding and
>> >  > >  > removing of rules.
>>
>> >  > >  > The complete list of changes:
>>
>> >  > >  > <ul>
>> >  > >  > <li>Fixed invalid-form event, now only triggered when form is 
>> > invalid</li>
>> >  > >  > <li>Added spanish (es), russian (ru), portuguese brazilian (ptbr),
>> >  > >  > turkish (tr), and polish (pl) localization</li>
>> >  > >  > <li>Added removeAttrs plugin to facilate adding and removing 
>> > multiple
>> >  > >  > attributes</li>
>> >  > >  > <li>Added groups option to display a single message for multiple
>> >  > >  > elements, via groups: { arbitraryGroupName: "fieldName1 
>> > fieldName2[,
>> >  > >  > fieldNameN" }</li>
>> >  > >  > <li>Enhanced rules() for adding and removing (static) rules:
>> >  > >  > rules("add", "method1[, methodN]"/{method1:param[, 
>> > method_n:param]})
>> >  > >  > and rules("remove"[, "method1[, method_n]") </li>
>> >  > >  > <li>Enhanced rules-option, accepts space-seperated string-list of
>> >  > >  > methods, eg. {birthdate: "required date"}  </li>
>> >  > >  > <li>Fixed checkbox group validation with inline rules: As long as 
>> > the
>> >  > >  > rules are specified on the first element, the group is now properly
>> >  > >  > validated on click</li>
>> >  > >  > <li>Fixed #2473, ignoring all rules with an explicit parameter of
>> >  > >  > boolean-false, eg. required:false is the same as not specifying
>> >  > >  > required at all (it was handled as required:true so far)</li>
>> >  > >  > <li>Fixed #2424, with a modified patch from #2473: Methods 
>> > returning a
>> >  > >  > dependency-mismatch don't stop other rules from being evaluated
>> >  > >  > anymore; still, success isn't applied for optional fields</li>
>> >  > >  > <li>Fixed url and email validation to not use trimmed values</li>
>> >  > >  > <li>Fixed creditcard validation to accept only digits and dashes
>> >  > >  > ("asdf" is not a valid creditcard number)</li>
>> >  > >  > <li>Allow both button and input elements for cancel buttons (via
>> >  > >  > class="cancel")</li>
>> >  > >  > <li>Fixed #2215: Fixed message display to call unhighlight as part 
>> > of
>> >  > >  > showing and hiding messages, no more visual side-effects while
>> >  > >  > checking an element and extracted validator.checkForm to validate a
>> >  > >  > form without UI sideeffects</li>
>> >  > >  > <li>Rewrote custom selectors (:blank, :filled, :unchecked) with
>> >  > >  > functions for compability with AIR</li>
>> >  > >  > </ul>
>>
>> >  > >  > As always, feedback is welcome!
>>
>> >  > >  > Jörn
>

Reply via email to