I created a Captcha validator but It overrides the Dreamweaver Spry validator that validates the entire form and submits it. How do I get it to get it to append to or work with the spry validator. The captcha validator is below. I don’t want it to submit the form. I want it to proceed to the spry validator that validates the entire form.
function checkform(theform){
var why = "";
if(theform.txtInput.value == ""){
why += "- Security code should not be empty.\n";
}
if(theform.txtInput.value != ""){
if(ValidCaptcha(theform.txtInput.value) == false){
why += "- Security code did not match.\n";
}
}
if(why != ""){
alert(why);
return false;
}
}
// Validate the Entered input aganist the generated security code function
function ValidCaptcha(){
var str1 = removeSpaces(document.getElementById('txtCaptcha').value);
var str2 = removeSpaces(document.getElementById('txtInput').value);
if (str1 == str2){
return true;
}else{
return false;
}
}
// Remove the spaces from the entered and generated code
function removeSpaces(string){
return string.split(' ').join('');
}
1.I solved the problem by removing the checkform function above
2. Then create an input field and validate it against the output of the txtCaptcha generated by the code below. That way my Form gets validated by my original validator. (no Conflicts