Hey im makin a html site and wanted to put in a registration ( username/password) where it stores it on the site so they can log in there. The prob is ive googled it and asked people but recieved nothing. heres an example http://www.webdeveloper.com/forum/ne...ote=1&p=495289
Well for starters, HTML can't do what you wish. You can do a simple version with javascript, but anyone with any savvy at all will view your source code and swipe the password. If you want to do it properly, it requires a database and serverside scripting.
Well for starters, HTML can't do what you wish. You can do a simple version with javascript, but anyone with any savvy at all will view your source code and swipe the password. If you want to do it properly, it requires a database and serverside scripting.
That won't stop anyone, believe me. But anyway, post the HTML to the login you have now, and I'll give you a simple javascript
I dont have a login thats what im sayin do you want me to post the entire script?? I have ALOT OF THINGS OUT OF ORDER and Im 14 so its not a good (graphics) site
<script language="JavaScript">
function validatePwd() {
var invalid = " "; // Invalid character is a space
var minLength = 6; // Minimum length
var pw1 = document.myForm.password.value;
var pw2 = document.myForm.password2.value;
var pw3 = document.myForm.username.value;
// check for a value in both fields.
if (pw1 == '' || pw2 == '' || pw3 == '') {
alert('Error: Please fill all the fields.');
return false;
}
// check for minimum length
if (document.myForm.password.value.length < minLength ) {
alert('Error: Password must be at least ' + minLength + ' characters long.');
return false;
}
// check for spaces
if (document.myForm.password.value.indexOf(invalid) > -1) {
alert("Error: Space character is not allowed in password");
return false;
}
else {
if (pw1 != pw2) {
alert ("Error: The passwords do not match.");
return false;
}
else {
alert('Congratulations! You filled all the fields correctly.');
return true;
}
}
}
</script>
Can you post the HTML part that you have? Do you have the text boxes and the form itself coded? If you do, I can give you a simple javascript for the login
I think you should learn HTML before you do this. I'm amazed that page even displays, it's nowhere near a valid HTML document. I'm not gonna be able to do anything with that, sorry man.
I can't, you don't even have any text boxes there. What is the script going to test the contents of?
Beyond that, it would be a miracle if any script would even function on that page. Every HTML doc. need just 1 set of HTML tags, 1 set of body tags, 1 set of head tags, and you have.............well.................lots of em.
Bookmarks