maybe this tutorial can be helpful. it’s with checkboxes but you can apply the same principle to any other input