inputEx - RatingStars Usage

Basic RatingStars creation

Use the following code to create a basic inputEx SelectField.

			new Y.inputEx.RatingStars({
				name: 'star1',
        averageValue: 4.5,
				parentEl: 'container1'
			});
		

Change the number of stars

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'
			});
		

Change the message under the field

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'
			});
		

Display Messages on mouseOver

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'
			});
		

StandAlone Form

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'          
          } 
			});
		

Display Messages on disabled

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'
			});