Added requirement that usernames be exclusively alphanumeric
This commit is contained in:
parent
db06888ecb
commit
6329d96331
@ -52,11 +52,11 @@ try { // Try opening the SQL database connection
|
||||
<p>Get started on your trophy-winning journey with your very own TrojanDestinyRL account!</p>
|
||||
<hr>
|
||||
<p></p>
|
||||
<form id="userForm" action="admin/user_management/add_user.php" onsubmit="return verifyInput()" method="POST" target="dataFrame">
|
||||
<form id="userForm" action="admin/user_management/add_user.php" onsubmit="return verifyInput()" method="POST" target="dataFrame" >
|
||||
<!-- THIS DIV IS FOR INPUT -->
|
||||
<div id="textInputArea">
|
||||
<label for="username" class="inputLabel">Username:</label>
|
||||
<input type="text" id="username" name="username" class="newLine" maxlength="30" onchange="usernameConfirm()" tabindex="1">
|
||||
<input type="text" id="username" name="username" class="newLine" maxlength="30" onchange="usernameConfirm()" tabindex="1" pattern="[a-zA-Z0-9]*" required>
|
||||
<p id="confirmUsername"></p>
|
||||
<label for="password" class="inputLabel">Password:</label>
|
||||
<input type="password" id="password" name="password" required tabindex="1">
|
||||
@ -68,7 +68,7 @@ try { // Try opening the SQL database connection
|
||||
<p id="matchingPasswordsText"></p>
|
||||
</div>
|
||||
<p> </p>
|
||||
<input type="submit" value="CREATE" tabindex="1">
|
||||
<input type="submit" value="CREATE" tabindex="1">
|
||||
</form>
|
||||
<p> </p>
|
||||
</div>
|
||||
|
@ -21,11 +21,16 @@ function verifyInput() {
|
||||
|
||||
// Check if the username is filled out
|
||||
var username = document.forms["userForm"]["username"].value;
|
||||
|
||||
// Alert if not
|
||||
if (username == "") {
|
||||
alert ("Must enter a username!");
|
||||
return false;
|
||||
}
|
||||
// Check if the name is already taken
|
||||
if (!usernameConfirm()) {
|
||||
alert ("Username already taken!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if a password is required, if so, make sure one is entered
|
||||
var password = document.forms["userForm"]["password"].value;
|
||||
@ -46,10 +51,6 @@ function verifyInput() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!usernameConfirm()) {
|
||||
alert ("Username already taken!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function displayPassword() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user