Ahhh... spoke too soon.  Same error:

syntax error for:

> if ( atpos<   1 || dotpos<   atpos + 2 || dotpos + 2 ==
fieldToValidate.val().length )



-----Original Message-----
From: Rick Faircloth [mailto:r...@whitestonemedia.com] 
Sent: Monday, October 31, 2011 5:19 PM
To: cf-talk
Subject: RE: OT, JS : Why am I getting this error?


Well... with a refresh after the change (this stuff is AJAX'ed
and sometimes changes document changes don't refresh
like I think they would) the validation seems to be
working correctly.

Thanks for the feedback, Jonah! :o)

Rick

-----Original Message-----
From: .jonah [mailto:jonah....@creori.com] 
Sent: Monday, October 31, 2011 4:51 PM
To: cf-talk
Subject: Re: OT, JS : Why am I getting this error?


what I'd do in this case is log each of the tests above the if.

console.log(atpos);
console.log(dotpos);
console.log(fieldToValidate.val().length);

console.log(atpos <  1);
console.log(dotpos <  atpos + 2);
console.log(dotpos + 2 == fieldToValidate.val().length);

And see what's erroring.

On 10/31/11 1:42 PM, Rick Faircloth wrote:
> Yeah, I caught that one after sending my message.
>
> Now, I'm getting: 'syntax error'
>
> for:
>
> if ( atpos<   1 || dotpos<   atpos + 2 || dotpos + 2 ==
> fieldToValidate.val().length )
>
>
>
> -----Original Message-----
> From: .jonah [mailto:jonah....@creori.com]
> Sent: Monday, October 31, 2011 4:28 PM
> To: cf-talk
> Subject: Re: OT, JS : Why am I getting this error?
>
>
> In JS Comparison (what you are doing) is "==", while assignment (what
> it's complaining about) is "=".
>
> On 10/31/11 1:19 PM, Rick Faircloth wrote:
>> Assuming the vars are correctly assigned,
>> why would this statement:
>>
>> var atpos = fieldToValidate.val().indexOf('@');
>> var dotpos = fieldToValidate.val().lastIndexOf('.');
>>
>> if ( atpos<   1 || dotpos<   atpos + 2 || dotpos + 2 =
>> fieldToValidate.val().length )
>>
>> give me this error for the "if" line above in firebug:
>>
>> 'invalid assigned left hand site'
>>
>> Without making any wade through all the code involved
>> at this point, is there anything in the code above
>> that is wrong?
>>
>> The syntax of the line in question came straight from
>> the W3C site...
>>
>> Thanks for any feedback!
>>
>> Rick
>
>
> 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348377
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to