Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2009, 05:56 PM   PM User | #1
hothousegraphix
Regular Coder

 
Join Date: May 2003
Location: Chicago, IL
Posts: 131
Thanks: 3
Thanked 0 Times in 0 Posts
hothousegraphix is an unknown quantity at this point
jQuery star rating plugin question

I'm using this star-rating plugin http://www.fyneworks.com/jquery/star-rating/ and the call back function provided to allow for submission of forms onclick of rating star.
Code:
$(document).ready(function() { 
	$('form.entry_rating').rating( { 
		callback:function(value, link) { 
		alert(value);
		}
	});
});
However, once the callback is included I get an error I've been trying to track down for the past day and a half.

In IE the error thrown is "Object doesn't support this property or method" on Line 100 character 4.

In my JS debugger the plugin breaks on line 99
Code:
var n = (this.name || 'unnamed-rating').replace(/\[|\]/, "_");
I would guess that for some reason the form class is not being passed but I'm not sure about this. I can't us ID as my key because this is dynamic and always changing.

I can definitely say this is related to the callback function because when it is not included no errors occur. I've tried re-naming the form referenced in the function in a multitude of ways none of which seems to have had any affect.

Any advice would be welcome.

Thanks.

Last edited by hothousegraphix; 01-10-2009 at 04:38 PM..
hothousegraphix is offline   Reply With Quote
Old 01-10-2009, 08:06 AM   PM User | #2
rangana
Senior Coder

 
rangana's Avatar
 
Join Date: Feb 2008
Location: Cebu City, Philippines
Posts: 1,752
Thanks: 65
Thanked 372 Times in 365 Posts
rangana will become famous soon enoughrangana will become famous soon enough
You're still experiencing the problem?

It seemed you're no longer using this code on the page you've linked to us:
Code:
$(document).ready(function() { 
	$('form.entry_rating').rating( { 
		callback:function(value, link) { 
		alert(value);
		}
	});
});
...you're already using this:
Code:
$(document).ready(function() { 

	$('.auto-submit-star').rating( { 
		callback:function(value, link) { 
		this.form.submit();
		}
	 
	});
	
});
Let us know if I miss something else.
__________________
Learn how to javascript at 02geek

The more you learn, the more you'll realize there's much more to learn
Ray.ph
rangana is offline   Reply With Quote
Old 01-10-2009, 04:37 PM   PM User | #3
hothousegraphix
Regular Coder

 
Join Date: May 2003
Location: Chicago, IL
Posts: 131
Thanks: 3
Thanked 0 Times in 0 Posts
hothousegraphix is an unknown quantity at this point
Sorry...I ultimately found the solution to the trouble I was experiencing late last night.

Unfortunately, the docs provided with the plugin do not elaborate on the specific usage of the "callback" and exactly how to implement.

It turns out that the "class" referenced is not to the form containing the "radio" buttons, but rather the radio button group itself. Additionally, there is no flexibility in naming. The class called must be the ".auto-submit-star" class shown in the example.

Easy to understand once you're aware of these particulars but clearly this is just one more case of poor documentation; too many assumptions made about what people will take away from the information provided.

I appreciate you taking the time to look at my post.

Thanks much!

Regards.
hothousegraphix is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:26 PM.


Advertisement
Log in to turn off these ads.