Cheers for your quick reply -
that's really odd that they all use the same callback, I thought that
as the app steps through the for loop, then as the 'i' is incremented
then it would also act as the input variable for the event it's being
assigned to.
If i put:
Event.observe($('star1'), 'click',
function(e){objRating.setRating(1)});
Event.observe($('star2'), 'click',
function(e){objRating.setRating(2)});
Event.observe($('star3'), 'click',
function(e){objRating.setRating(3)});
Event.observe($('star4'), 'click',
function(e){objRating.setRating(4)});
Event.observe($('star5'), 'click',
function(e){objRating.setRating(5)});

then it all works ok.
very odd - still trying to get my head around it!

Sorry to ask, but in your example, do you suggest using that line 5
times or is that an indication to looping 5 times?

Cheers,
j


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to