Den plejer da at virke.. :D
Den brokker sig, hvis man ikke udfylder brugernavn
Her er min join side:
...
...
<script type="text/JavaScript" src="includes/js/func.js"></script>
<script src="
https://unpkg.com/xregexp/xregexp-all.js"></script>...
...
<form action="includes/registre.inc.php" method="post" name="signup_form">
<br />
<input id="username" name="username" placeholder="<?=$InputUsernamePlaceholderText?>" type="text">
<br />
<input id="password" name="password" placeholder="<?=$InputNewPasswordText?>" type="password">
<br />
<input id="conf" name="conf" placeholder="<?=$RepeatNewPasswordText?>" type="password">
<br />
<input class="button" name="submit" type="submit" value="<?=$JoinButtonText?>" onclick="return regformhash(this.form, '', this.form.username, this.form.password, this.form.conf);" ><br />
</form>
js funktionen:
function regformhash(form, uid, username, password, conf) {
// Check each field has a value
if (uid.value == '' ||
username.value == '' ||
password.value == '' ||
conf.value == '') {
alert('You must provide all the requested details. Please try again');
return false;
}
re = /^[^\s]+$/;
if(!re.test(form.username.value)) {
alert("Username cannot contain spaces. Please try again");
form.username.focus();
return false;
}
...
...
}