Please help! Database query

It’s very simple login form. I’m struggling for 1 week now. I read all the topics and the documentation , but I’m newbie and quite confused about Javascript. Please Help me!

I need onClick event where the data from textbox to be compared to certain item in the collection, but with conditional statements .
Example:
IF userinputEmail.text IS FOUND IN (“Members” , eMail) THEN
#userinputPassword .show
(afterwards compare the password with the existing one and link to dynamic page with the members ID)
else
#userinputName .show
#userinputPassword .show
#userinputEmail .show
Thank you it’s very important for me!

I assume you are trying to navigate a member straight to they Dynamic Page that corresponds the member, based on their member ID. Hence, the user will log in and go straight to their individual dashboard or personalized page. I am trying to do the exact same thing.

Yes . I also want the user to do some action and store the result in “his” database. I’m struggling with Comparing the inputs to the database…