2 Replies Latest reply on Oct 17, 2012 10:01 AM by bruderbell84

    Text Field Formatting

    bruderbell84

      I'm trying to set the format of a text field of a newly created field to "Date" with mm\dd\yyyy but am struggling to do so programmatically.  The option I'm after is in the GUI of the text field properties, format tab. 

       

      Based on my googling and reading of this forum, this is my code:

       

      var name = "MyFields.DOB";

      var type = "text";

      var page = 0;

      var location = [525, 713, 586, 695];

      var myField = this.addField(name, type, page, location);

      myField.setAction("Format","AFDate_FormatEx\(mm\/dd\/yyyy\)");

       

      After the code runs, I get the field and the format is set to 'custom' with the AFDate_... string as the custom format script.  But when I subsequently type in a date, it seems to be accepting anything I type.

       

      Ideas?