core icon indicating copy to clipboard operation
core copied to clipboard

Form Handler - Required and Regular Expression validations fail when the form contains a tab field

Open gabbydotCMS opened this issue 14 years ago • 2 comments

When adding a tab field to a form structure, the validation of required fields or fields with regular expressions in that tab fails when trying to advance to the next tab.

Ozzy found out that this issue is caused by this line of code in the file contentformmacro.vtl :

"if(!validateRegularExpresion(document.getElementById("$field.velocityVarName"), "$regExp", "$field.fieldName")){"

Ozzy changed that to be:

if(!validateRegularExpresion(document.getElementById("$field.velocityVarName"), "$field.getRegexCheck()", "$field.fieldName")){

and the validation error didn't occur anymore.

This is a show stopper for the Secure Form project, so we applied this change to the secure form plugin since we were already overriding that file.

gabbydotCMS avatar Jul 13 '12 21:07 gabbydotCMS

There's an additional issue with the regular expression validation. I'll add code as soon as we have tested.

gabbydotCMS avatar Jul 17 '12 22:07 gabbydotCMS

Seems that this is still not fixed: http://screencast.com/t/904XycctW .... I have created another issue: https://github.com/dotCMS/dotCMS/issues/923

DeanGonzalez avatar Aug 09 '12 17:08 DeanGonzalez