AnsweredAssumed Answered

Field Validation in Request Form

Question asked by Marta Benedetti on Dec 17, 2020

Hi everyone,

 

I've created a new request form in order to create a new user on AD and I'd like to add a sort of validation in some fields such as email address.

 

In order to do this I've added a field of type Javascript Block in order to check that the field email:

 

avform.registerExprSub(null, "${avform.email}", function(value){

alert(validateEmail(avform.email))
});

function validateEmail(email)
    {
        var re = /\S+@\S+\.\S+/;
        return re.test(email);
    }

 

The problem is that the button "next" at the bottom right of the form is not actually blocking the user if he enters an email that is not correct.

Maybe this is not the correct way to do this, do you have any suggestion?

 

Thank you

 

Marta

Outcomes