I need to create a script that checks an input box (password) for the occurrence of the same character appearing twice. This script should work alongside existing regex validation. I believe I will need to use a loop to check if any character appears twice, but I am unsure about the conditions for this function. If anyone has suggestions on how to accomplish this, it would be greatly appreciated. For example: "ABad12" should pass, while "AbAc12" should return false. Thank you in advance.
function checkForm(form)
{
var re = /^\w{6,10}$/;
if(!re.test(form.pwd1.value)) {
alert("Error: Password must be between 6-10 characters!");
form.inputfield.focus();
return false;
}
}
Above is an example of the script I want to combine with additional regex validations.