Use the following code to create a basic inputEx SelectField.
new Y.inputEx.RatingStars({ name: 'star1', averageValue: 4.5, parentEl: 'container1' });
Use the following code to change the number of stars
new Y.inputEx.RatingStars({ label: 'Rate this one !', name: 'star1bis', averageValue: 2.3, nStars: 8, nRates: 25, parentEl: 'container1bis' });
Use the following code to change the message field
new Y.inputEx.RatingStars({ name: 'star2', averageValue: 2.3, nRates: 30, parentEl: 'container2', message : 'Yo!, average Rate is %, % ratings have been made' });
Use the following code to change the message field
new Y.inputEx.RatingStars({ name: 'star2', averageValue: 2.3, nStars: ["Not Cool","Half-Cool","Cool","Super Cool","Coolest Ever"], nRates: 30, parentEl: 'container3' });
Use the following code to make a configurable form that send rates with ajax
new Y.inputEx.RatingStarsForm({ ratingStarsOptions: { name: 'star', averageValue: 2.3, nStars: ["Not Cool","Half-Cool","Cool","Super Cool","Coolest Ever"], nRates: 30 }, parentEl: 'container4', ajax: { method: 'POST', uri: 'default.php' } });
Use the following code to display a disable Message
new Y.inputEx.RatingStars({ name: 'star3', averageValue: 2.3, disabled: true, disableMessage: "sorry the stars are disabled", nRates: 30, parentEl: 'container5' });