I couldn't figure out how to prevent user from submitting without having rating selected, but I didn't know how to check if rating button is not clicked and display an alert message. Tried also to check if :focus on any button is active and if not, then display an alert, but I couldn't reach it in JS. My next idea was to change buttons into radio inputs, hide them and catch their labels as buttons, but I think a label can't have an active state like :focus so I gave up. Any ideas how to solve the problem? Also any other feedback and advice would be highly appreciated.
Kacper
@kacper-reimanAll comments
- @kacper-reimanSubmitted almost 2 years ago@kacper-reimanPosted almost 2 years ago
thanks for all your effort to help me. i've made some improvements in JS, feel free to check them out. also added animations to make switching windows look a bit nicer. But i've noticed another problem : I checked if everything works properly in chrome and mozilla devtools touch mode for mobile devices, and it did. However, tapping button on actual mobile device(iPhone 11) doesn't give it properties defined by :focus state, instead it leaves button with its :hover properties.
1