On 13 January 2016 at 20:13, David Williams <li...@ruby-forum.com> wrote:
> Walter Davis wrote in post #1180603:
>>>> It's giving me Nan when I wrap the parseInt method around the counter.
>>>
>>> Check that your spelling of the attribute is correct, note the typo in the
>> example. Also, if you want to be extra-careful (just had to deal with
>> this
>> yesterday) you can go all belt-and-suspenders on it:
>>>
>>>    parseInt( 0 + counter.data('maximum-length') )
>>
>> Sorry, left out one more bit here:
>>
>>   parseInt( 0 + counter.data('maximum-length'), 10 )
>
> It's still giving me NaN, you can try the code if you want on a test
> html form or text area.

Have you tried inserting
alert( counter.data('maximum-length') )
to see what the value is?  then assuming it looks ok
alert (0 + counter.data('maximum-length'))
and
alert( parseInt( 0 + counter.data('maximum-length'), 10 ) )

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtrW0e-%2BWyppmuX8zUVo38Ly%2BC1d-uXq9xQ%2Bxn%2BXqBr5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to