Validation of two fields in attach form

Hello,

I have a window and I attach a form. In this form I have two fields: email and copyemail, the first I must validate with notempty and the sencond must validate with the same value than email.

I write this:

var ventanaAlta= dhxWins.createWindow(‘ventanaAlta’, 200, 200, 600, 300);
var form_1 = ventanaAlta.attachForm(str);

var str = [
{ type:“input” , name:“email”, label:“eMail”, value:"", validate:“ValidEmail”, width:250, labelWidth:“250”, labelHeight:“21”, inputWidth:“250”, inputHeight:“21”, labelLeft:“15”, labelTop:“90”, inputLeft:“15”, inputTop:“111”, position:“absolute” },
{ type:“input” , name:“copyemail”, label:“Confirmaciòn”, value:"", validate:“vCopyeMail”, width:250, labelWidth:“250”, labelHeight:“21”, inputWidth:“250”, inputHeight:“21”, labelLeft:“290”, labelTop:“90”, inputLeft:“290”, inputTop:“111”, position:“absolute” }

        function vCopyeMail(data){
                var v =  form_1.getItemValue("email"); 
                var v2 = form_1.getItemValue("copyemail"); 
                return (v == v2);
        };

All the time don’t match, validate is false.

Can you say me the error?

thanks a lot!

We cannot reproduce this issue locally. Following code works as expected at local example:

<script> var myForm, formData; function doOnLoad() { var formData = [ { type:"input" , name:"email", label:"eMail", value:"", validate:"ValidEmail", width:250, labelWidth:"250", labelHeight:"21", inputWidth:"250", inputHeight:"21", labelLeft:"15", labelTop:"90", inputLeft:"15", inputTop:"111", position:"absolute" }, { type:"input" , name:"copyemail", label:"Confirmacion", value:"", validate:"vCopyeMail", width:250, labelWidth:"250", labelHeight:"21", inputWidth:"250", inputHeight:"21", labelLeft:"290", labelTop:"90", inputLeft:"290", inputTop:"111", position:"absolute" }, {type: "button", value: "Validate", command: "doFormValidate"}] myForm = new dhtmlXForm("myForm", formData); myForm.attachEvent("onButtonClick", function(name, command){ window[command](); }); } function doFormValidate() { myForm.validate(); } function resetValidateData() { myForm.resetValidateCss(); } function vCopyeMail(data){ var v = myForm.getItemValue("email"); var v2 = myForm.getItemValue("copyemail"); return (v == v2); }; </script>