Look up clousers (sp?) they are used for varriables usualy with the  
time function. All I have this weekend is my phone so I'm just trying  
to pull stuff off the top of my head.

Sent from my iPhone

On Nov 15, 2009, at 7:52 AM, "sprach" <bensprach...@gmail.com> wrote:

> Sarah,
>
> Thanks for trying to help.  The problem is definetly a scope problem.
> I
> just don't know how to pass the <object>.<function>. (form.submit)
> into
> the  callback function that $.get() creates. I have tried to create a
> "global"
> var to assing the form object to, but that doesn't work either.  I
> don't really
> understand the scope that the call back function is in, and the
> validator's
> form object.
>
> I need to include  the form.submit() call  in the $.get's callback
> function
> because of the asynchronous nature of
> AJAX.  The $.get()'s callback is not called until the response comes
> back from the server. If I call the form.submit() funcition before the
> response
> comes back, I will either not know whether the server was able to
> validate
> the credentials.
>
> -ben
> On Nov 15, 4:59 am, "Atkinson, Sarah" <sarah.atkin...@cookmedical.com>
> wrote:
>> I've never used the get() I wonder If you have a scope problem. You
>> might try a closer. Also if your calling a method you need to
>> reference the object that the method is part of. I haven't yet gotten
>> to the submit part--hopeing to study more validator stuff tonight.  
>> But
>> form.submit() is saying u have an object valuable called form and it
>> has a method of submit()
>>
>> Sent from my iPhone
>>
>> On Nov 15, 2009, at 4:44 AM, "sprach" <bensprach...@gmail.com> wrote:
>>
>>
>>
>>> $('form').submit() causes the jquery submit to be fired which is  
>>> then
>>> interecepted
>>> again by validator which causes the infinite recursion problem.  I
>>> need to use validator's
>>> form.submit() method. I just can't get to it from the callback used
>>> by
>>> $.get().
>>
>>> -ben
>>
>>> On Nov 15, 4:28 am, "Atkinson, Sarah"  
>>> <sarah.atkin...@cookmedical.com>
>>> wrote:
>>>> Try $('form').submit()
>>
>>>> Sent from my iPhone
>>
>>>> On Nov 14, 2009, at 10:44 PM, "sprach" <bensprach...@gmail.com>
>>>> wrote:
>>
>>>>> I am new to javascript, jquery and validator, but really see the
>>>>> potential and am trying to use in a new application.  I am  
>>>>> having a
>>>>> little trouble wrapping my head around the layers of callbacks.
>>
>>>>> I have a simple login form that I want to validate, but want to  
>>>>> send
>>>>> an md5 encrypted password to the server.  All of my validation  
>>>>> works
>>>>> until I try and submit the form.   Here is the code snippet of the
>>>>> validator submit handler:
>>
>>>>> ....
>>>>> submitHandler: function(form) {
>>
>>>>>                        var pwd = $('#password').val();  // md5
>>>>> encode
>>>>> the password
>>>>>                        md5pwd = hex_md5(pwd);
>>>>>                        //$('#password').val(pwd);
>>
>>>>>                        $.get('../UVServer/login.php','email='+$
>>>>> ('#email').val()+ '&password='+ md5pwd,
>>>>>                        function(resp) {
>>>>>                            if (resp == 'false')
>>>>>                            {
>>>>>                                // password didn't match
>>>>>                                validator.showErrors({"password":
>>>>> "Incorrect Password or Email Address!"});
>>
>>>>>                                return false;
>>>>>                            }
>>>>>                           form.submit();  // Password matched,
>>>>> submit
>>>>> the form
>>
>>>>>                        })
>>
>>>>>                    },
>>>>> ...
>>
>>>>> The problem that I run into is that I cannot call form.submit() in
>>>>> the
>>>>> anonymous call back that I use for the jquery $.get call.  In the
>>>>> code
>>>>> above, firebug claims that form.submit() is not a function.
>>
>>>>> I have tried many work arounds but nothing seems to work.  I don't
>>>>> want to use the "remote" rule, because I don't want to pass the
>>>>> unencrypted password to the server.
>>
>>>>> Help greatly appreciated.- Hide quoted text -
>>
>>>> - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -

Reply via email to