Hi Wil,
Are you specifying JavaScript or FormCalc as the scripting language for your code?
What you specified above should work in FormCalc but if you've specified JavaScript, it would generate an error because you're missing semicolons at the end of every line:
TextField1.mandatory = "error";
TextField1.mandatoryMessage = "mandatory field!";
Try pressing [Ctrl + J] while the form is loaded in Acrobat (works in the Preview pane in LC Designer as well) to see if there's an error message of some sort.
Also note that your custom "mandatory message" will only be displayed in the event that TextField1 has a value and this value is then removed completely (e.g. specify a value in TextField1, exit the field by tabbing-out or clicking somewhere else, enter the field again, remove the value and tab/click-out again). It won't be used when attempting to submit the form with an empty TextField1 field (in this case, Acrobat will show a generic error message indicating that "at least one mandatory field" wasn't filled).
Stefan
Adobe Systems