Make sure the validator.js file is loading. It might open in create mode as the
script file's URL is relative to /db.nsf/Form?Open whereas in edit mode it is
relative to /db.nsf/view/doc?open which a "directory" deeper.
If you're playing with stuff like this you really need to be using some kind of
sniffer or ideally you should develop with Firefox and Firebug!