How to fix hide/show password functionality across multiple forms on the same page? Answered

Post author
Valdis Zhvaginsh

Hey guys!

I had a problem with multiple forms on one page, or rather with the hide/show password functionality. If there is more than one form on the page where the hide/show password functionality is configured, it stops working.

If there is only one form on the page, everything works fine. There seems to be a conflict between attributes or IDs. Is there any way to resolve this?

Comments

2 comments

  • Comment author
    Duncan from Memberstack
    • Official comment

    Hi Valdis Zhvaginsh 👋

    Checkout this new version of the show hide password code. It uses data attributes instead of ids and should fix the issue. 

    https://www.memberstack.com/scripts/45-show-hide-password

  • Comment author
    Josh Lopez

    Hey Valdis Zhvaginsh 👋

    I have seen this come up before when multiple forms have the same IDs. According to W3 Schools IDs need to be unique. You can read more here. Try making each ID unique and see if that fixes the error. If it doesn't please let us know and we can look further. 🙏

    0

Please sign in to leave a comment.