How do you set a rating starting from a negative value?

Jan 14, 2016 at 1:23 PM
Edited Jan 14, 2016 at 1:48 PM
I am trying to create a scale from -1 to 10 with the select dropdown method.
Thus the default reset value should be "-1" and the first star to be value 0
But reset defaults to 0 instead of -1 and the first value becomes 1 instead of 0.
Please help.
Thanks.
Coordinator
Jan 16, 2016 at 8:06 AM
Can you post a JSFiddle?
Jan 27, 2016 at 7:05 AM
Hi Gidon,

Please have a look at this jsfiddle to see what I mean:
https://jsfiddle.net/kew7gdhc/9/

on load it defaults the value to "-1" - this is ok
when selecting the first rate item value is "1" - expected it to be 0
On reset the value shows "0" - expected -1

Thank you,
Hope this is clear.

Cheers.
Coordinator
Feb 8, 2016 at 10:39 AM
I see.

I would suggest adding data-rateit-min="-1" on your rateit div. The select box has always been a bit of an edge case, since it is not a "range-control" by design. So sometimes we just have to guide rateit a little so it grabs the correct values from the select box.

You could also "post" calculate the correct rating. So have your select box show options 1-10, and then afterwards correct them to the values you want.

Cheers,
Gidon
Feb 12, 2016 at 8:24 AM
Thanks Gidon,

I shall try that out.

Cheers.

Chirag