Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

HTML, CSS, and Javascript (jQuery) for Dynamic Form

jquery
Spencer Daniel•50
@WhaleMentalist
A solution to the Interactive rating component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


This challenge was tougher than I expected. Stylizing the radio buttons was interesting. I ended up using 'display: none' to hide the radio buttons themselves and used the labels associated with each button. It actually ended up looking pretty good, but I am not sure if it was the proper way to do it. The rest of the form was pretty straight forward.

The jQuery was used to allow the user to be presented with another card after rating submission. I ended up using the 'hide()' and 'show()' to exchange out the rating and thank you cards. The functions allowed the cards to be animated for a smoother effect. The only odd thing was I needed to add a 'event.preventDefault()' to prevent the submission from redirecting. My understanding is the function is a way of saying "Hey, I got things handled here, no need to do anything". I do wonder if this is a common thing or if there is a better way to handle this odd scenario.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Spencer Daniel's solution.

Join 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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License