r/learnjavascript • • 17d ago

Simple Password input field

Hi all, I've been learning webcoding recently and Ive been wanting to make a website to use as a prop in my tabletop games.

My biggest desire right now is to do a password input where submitting an incorrect input displays an error message, while the correct input provides a redirect to a new page.

Since this will only be for my friends and wont host any private data, I'm not too concerned for heavy security, but most resources online are for actual websites and online security. Whats the best way for me to implement something like this?

6 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/Successful-Throat621 16d ago

I think the formatting got a little messed up when you pasted this into reddit? I tried putting in my code but i cant seem to clean it up into a way that works

1

u/Both-Tart7460 3d ago

hey so sorry about that! reddit's rich-text editor completely ate my line breaks when i pasted it earlier 😅

i just edited my comment above in markdown mode so the <form> and <script> block is clean and copy-pasteable now. hope your tabletop session goes awesome!