Topic
1 reply Latest Post - ‏2011-06-15T14:19:10Z by SystemAdmin
alexandre.barbosa
alexandre.barbosa
2 Posts
ACCEPTED ANSWER

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

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

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.
Thanks.
Updated on 2011-06-15T14:19:10Z at 2011-06-15T14:19:10Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    53 Posts
    ACCEPTED ANSWER

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

    ‏2011-06-15T14:19:10Z  in response to alexandre.barbosa
    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.