Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
how to do thishow do i create a page in html that allows a user to enter a username and password by javascript
Posted
Comments
CHill60 6-Feb-15 7:11am    
What have you already tried?

 
Share this answer
 
The answer is no. HTML and JavaScript are client-side technologies and anyone can see their source. How could you possibly store passwords under such a setting? HTML, JavaScript, and CSS form only one side of web applications. The other side is the server-side technologies such as server-side scripting for validating log in credentials and databases for storing the user accounts. Read more: Beginner's Guide to HTML5 & CSS3 - Server Side Story[^]
 
Share this answer
 
Comments
enhzflep 6-Feb-15 15:33pm    
While I understand what you're saying and where you're coming from, this is a fairly poor answer in my opinion. It's certainly well-short of the usual standard of your articles.

Q: How do I xxxxx?
A: No. ....

You've made assumptions on the inquirer's intent and extrapolated from that to a position that makes the original question seem foolish. (Which it very well may be).


How do you know that the intention isn't to accept a username and password in one page before then going on to leverage Javascript to login to a _different_ site using these credentials? (Admittedly, it's unlikely - but not actually clear from the question) If this were the case, there would be no need to store the username/password anywhere, rendering much of your answer entirely moot.

Perhaps even, the intention is to simply input two strings.

Basically, this question seems like a perfect candidate for asking clarifying questions.
Peter Leow 7-Feb-15 0:29am    
I see your point and I respect that. Thank you, enhzflep.
enhzflep 9-Feb-15 17:16pm    
You're welcome Peter, I hope there's no hard feelings. :)
Peter Leow 9-Feb-15 23:00pm    
Not at all. We are always learning from one another. Cheer!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900