Try this:

$phoneNumber.data("previousValue", null).valid()

Jörn

On Wed, Apr 1, 2009 at 8:04 PM, pbindagorge <pmbar...@gmail.com> wrote:
>
> I have really tried to figure out how to do this, but I can't figure
> it out by what you wrote here. Can you please tell me more?
>
> Here's where I thought I should be attempting this. The "validator"
> var points to the return of $('#aspnetForm').validate()...
>
> $ddlCountries.change(function() {
>        var $phoneNumber = $('#phoneNumber');
>        if (validator && $phoneNumber.val() != '') {
>                //TODO: What do I add before this validator.element call in 
> order to
> clear the value cache for the element?
>                validator.element($phoneNumber);
>        }
> });
>
> On Apr 1, 1:28 am, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
> wrote:
>> You could remove the cached value from the element data. Then call
>> valid() on that element to run the validation again.
>>
>> Jörn
>>
>> On Wed, Apr 1, 2009 at 3:21 AM, pbarnes <pmbar...@gmail.com> wrote:
>>
>> > I need to use an ASMX service to validate a phone number. The Web
>> > method requires the phone number and the countryId.
>>
>> > I have the validation working fine except for the case where the user
>> > enters a valid number for, say, the default country (United States)
>> > and then selects some other country, not changing the phone number.
>>
>> > I can force validation when the country dropdown value changes by
>> > using the validator.element() method. But because (previous.old !==
>> > value) returns true (see line 897 in jquery.validate.js), the ajax
>> > call isn't made. What's the best way to force this call so that I can
>> > validate remotely when the country changes?

Reply via email to