• 1 reply
  • Latest Post - ‏2011-06-15T14:19:10Z by SystemAdmin
2 Posts

Pinned topic Doubt on Add Command Javascript in a Document Form Policy

‏2011-04-14T14:50:35Z |

I'm trying to add a new command, using javascript, in a document form policy. I already defined the command, but I don't have sure inhow can I set a script (Javascript). I search in the ecm_help, but I can't find any sample. I put this javascript code:

var cell = form.findCell(Mes);
var mesCell = cell.getValueAsString();
if(mesCell==undefined || mesCell==null || mesCell=='') {
alert("O campo 'Mês' é de preenchimento obrigatório");
return false;
} else {
return true;
But when I try to save the document, a popup with the value selected in the field in showed. I just want to validate de field to verify if it is a empty field, showing a alert message, in Portuguese.
Updated on 2011-06-15T14:19:10Z at 2011-06-15T14:19:10Z by SystemAdmin
  • SystemAdmin
    53 Posts

    Re: Doubt on Add Command Javascript in a Document Form Policy

    Why don;t use you just the built-in Check calculation method for this? It looks like all you're trying to do is test for a required value. There are two built-in methods for doing this within eForms Designer.