Ten Star Rating System

I am trying to create a 10 star rating system.


What I’ve done is, I’ve assigned a value for each stars. Whenever a user clicks on one of the stars, the value is displayed in the “#text9”. I did that by using the code:

export function iconButton3_click(event) {
//Add your code for this event here:
$w( ‘#text9’ ).text = “3” ;
$w( ‘#input1’ ).value = 3 ; // also setting the value 3 to the input text.
}

I’ve also added a textInput and connected it to the dataset BJP rating (id - #dataset2) to a field called “userRating” ( this is a number type field), so that i can use the submit button to store the rating provided by the user.


Now the trouble is that
$w( ’ #input1 ’ ).value = 3 ;
returns a string type value, and so after submission, there is error
“The value does not match the field type Number”

I know that if i turn the field type to Text it will work but then I won’t be able to perform tasks like Summing all rating, etc.

And I also the use of " insert " is too complicated for me as I’m a beginner.

Is there a way to get this done?

Thanking You
Danzong

Hi,
You can use the tutorial for 5 star rating system here and modify it to work with 10 stars.