Submitted about 2 years ago
Tela de avaliação responsiva utilizando CSS e Javascript
@mailacss
Design comparison
SolutionDesign
Community feedback
- @fico444Posted about 2 years ago
Hi Maila it's a nice solution. I only found a detail: If the user does not select any rating and presses submit, the script shows the thank you card. It must show a warning or a message. You can solve this by declaring ex as a global variable, calling from the HTML only the hide function, and adding a check inside it. Something like this...
var ex = 0;
function esconde(el) {
if( ex == 0 ){ alert("message"); }else{ var display = document.getElementById(el).style.display; if(display == "none") document.getElementById(el).style.display = 'block'; else document.getElementById(el).style.display = 'none'; mostra(el); }
}
I didn't test it so it may have some error but that would be the idea... I hope I have helped, regards 😉
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord