Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Wiki Markup |
---|
Hi, I have a form that some fields are validate with JavaScript. I attach the form: !Problema JavaScript - Joget.png|border=1! The Javascript that works in V2 is: <script type="text/javascript"> function formbuilderCustomValidation() { var containError = false; var slct1 = document.getElementsByName('campoAprobacion')\[0\]; var slct2 = document.getElementsByName('campoAceptarFactura')\[0\]; var slct3 = document.getElementsByName('campoTipoAprobacion')\[0\]; var txt1 = document.getElementsByName('campoOcultoTarea')\[0\]; if(txt1.value \!= 'Radicar Factura VASA'){ if(slct2.value.length == ''){ containError = true; alert("Seleccione el estado de aprobación de la factura"); } if(slct2.value == 'si'){ if(slct1.value.length == ''){ { containError = true; alert; alert("Seleccione una opción para aprobación"); } else{ if(slct1.value == 'si'){ if(slct3.value == '' \|\| slct3.value == '0'){ containError = true; alert; alert("Seleccione el concepto de aprobación"); }; } } } } } return containError; } </script> When I migrate the code into a CustomHTML, it doesn´t work. I apply some flags to see the behavior but I can´t see the alerts. Somebody can help me? Thanks\!\!\! <script type="text/javascript"> function formbuilderCustomValidation() { var containError = false; var slct1 = document.getElementsByName('campoAprobacion')\[0\]; var slct2 = document.getElementsByName('campoAceptarFactura')\[0\]; var slct3 = document.getElementsByName('campoTipoAprobacion')\[0\]; var txt1 = document.getElementsByName('campoOcultoTarea')\[0\]; alert("Entro 1"); if(txt1.value \!= 'Radicar Factura VASA'){ if(slct2.value.length == ''){ containError = true; alert("Seleccione el estado de aprobación de la factura"); } if(slct2.value == 'si'){ if(slct1.value.length == ''){ containError = true; alert("Seleccione una opción para aprobación"); } else{ if(slct1.value == 'si'){ if(slct3.value == '' \|\| slct3.value == '0'){ containError = true; alert("Seleccione el concepto de aprobación"); } } } } } return containError; } </script> |