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:[email protected]] 
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:348371
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to