Interactive component with rating
Design comparison
Solution retrospective
I had difficult to know which of input types i can use for the "rating options". I didn't use javascript because i dont know where i can place a function to return the input values(rate).
Community feedback
- @MerMory-AllocPosted over 1 year ago
Hi @Wellington-Lucas,I hope you are doing well. I took a look at your code and I think it would be better to set the form's method attribute to "post" so that the page does not reload.
Regarding JavaScript, you can get the value of the checked rating like this
function enviar(elementoSelecionado) { let value=elementoSelecionado.value ; \\"Then, write code to make the form disappear and the thanks section appear. }
Marked as helpful1@Wellington-LucasPosted over 1 year ago@MerMory-Alloc Thank you for the answer, i managed to put the value inside the second "card", but the solution with the method "post" did not work. So I found a solution on a forum with the .preventDefault() method
1@MerMory-AllocPosted over 1 year ago@Wellington-Lucas well that's a better solution, :) happy that works.
0
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