Not published yet

A Star Rating That Submits a Real Value, No JavaScript

The real input holds the value; the label is only the picture. Five radios and a few :has() rules send rating=3 — no script, and you get to delete the old row-reverse hack.

Publishing Monday morning · November 30, 2026
A Star Rating That Submits a Real Value, No JavaScript

You built a star widget, it lights up on click, and then the form submits no rating at all — or the Send button silently does nothing. The fix is one idea that transfers to every custom control: the real input holds the value, the label is only the picture. This builds a five-star rating from real radio inputs and ‘:has()’, shows exactly what reaches the server (rating=3, seen in a real browser, not claimed for all of them), and is honest that it’s three CSS rules, not the one-liner everyone promises — plus the keyboard and required-field behaviour you get for free, and the backwards ‘row-reverse’ markup you finally delete.

A Star Rating That Submits a Real Value, No JavaScript | Vibecodes