Bug Tracker

Changes between Initial Version and Version 1 of Ticket #3807


Ignore:
Timestamp:
Jan 7, 2009, 3:57:16 PM (11 years ago)
Author:
joern
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3807 – Description

    initial v1  
    1 {{{
    21It looks like the implementation of the remote method is supposed to
    32support custom messages from the server when using the remote method
     
    54
    65This quick change fixes the problem (details below)
    7 
     6{{{
    87From:
    98915                                     success: function(response) {
     
    1514916                                             if ( response === true ) {
    1615917                                                     var submitted = validator.formSubmitted;
    17 
     16}}}
    1817Because of type coercion, we can only see whether the response is
    1918"truthy" or "falsey" from this line. If we take a look at line 924:
    20 
    21 924                                                     errors[element.name] =  response || validator.defaultMessage
    22 ( element, "remote" );
    23 
     19{{{
     20924                                                     errors[element.name] =  response || validator.defaultMessage( element, "remote" );
     21}}}
    2422It would seem to be checking the response and assigning that to the
    2523error message if it is truthy, but it never can be because of the
     
    3735field, this is a useful feature for systems that need to do 2 or more
    3836distinct checks on a field at the server end.
    39 }}}