The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Username and Password Field
VaBoi25
post Feb 9 2017, 11:35 PM
Post #1





Group: Members
Posts: 8
Joined: 9-February 17
Member No.: 26,307



Hello all,

I am trying to create a login page for my website that requires users to enter a username and password. The password part is where I am getting hung up though. I need the passwords to contain special characters and the use of upper case letters. I am having a hard time finding the HTML code for this setup. Can anyone provide any assistance please? Thanks in advance.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
VaBoi25
post Feb 10 2017, 10:39 PM
Post #2





Group: Members
Posts: 8
Joined: 9-February 17
Member No.: 26,307



Hello all,

So, im trying to help a classmate of mine in her Web Design class. It has been a while since I have played with HTML so I was hoping to reach out to you all for some assistance. She is creating her "website" that will not run off of an actual "server". I just wanted to point that out. Her site is only visible to herself and those that she sends the HTML code to. A dummy site if you will. The requirements she needs may be fairly simple to you all. She needs her password field to administer constraints whenever the user enters a string of characters or numbers. More importantly, the password needs to have 7-9 characters, 2 numbers and 1 uppercase letter. In the most simple syntax, how could she accomplish this? I know Javascript is probably the best option, but this is all the help I could give. Any suggestions? I have left the code in the description as well in case anyone needed to see what has been done so far. Thanks in advance.








<!DOCTYPE html>
<html>
<head>
<!--

Login

Author:
Date:

Filename: login.htm
-->
<meta charset="utf-8" />

<title>Login</title>
<link rel="stylesheet" href="styles.css" />
<script src="modernizr.custom.65897.js"></script>

</head>

<body>
<header>
<h1>
Login
</h1>
</header>

<article>
<div id="errorMessage"></div>

<form action="home.htm">
<fieldset id="deliveryinfo"></fieldset>

<label for="userID">UserID</label>
<input type="text" id="usernameID" name="userID" />
<label for="passwordinput">Password</label>
<input type="password" id="passwordinput" name="password" />
<input type="checkbox" id="rememberinput" name="remember" value="remember" />
<label for="rememberinput" id="rememberlabel">Remember me</label>
<fieldset id="submitbutton">
<input type="submit" id="submitBtn" value="Login" />

</fieldset>


</form>
</article>

</body>
</html>



User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 11 2017, 10:41 AM
Post #3


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(VaBoi25 @ Feb 11 2017, 04:39 AM) *

im trying to help a classmate of mine in her Web Design class.

If this is a school assignment it should already indicate which scripting language to use. unsure.gif

QUOTE
She needs her password field to administer constraints whenever the user enters a string of characters or numbers. More importantly, the password needs to have 7-9 characters, 2 numbers and 1 uppercase letter. In the most simple syntax, how could she accomplish this?

This requires a relatively advanced javascript, perhaps together with Regex.

Or you might use an INPUT element together with the HTML5 PATTERN attribute and a Regex, but again this is pretty advanced.

In either case it's only use would be for form validation, not actual password protection.




User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 03:49 AM