Here is a plugin to check fields when you create or edit a document.
I had the same problem as I had with this plugin :
http://modxcms.com/forums/index.php/topic,36409.0.html
The translation is probably not very good
//<?php
/**
* Required_fields
* Check if the fields title, longtitle, description and content are not empty
* The plugin needs to listen OnBeforeDocFormSave event
*
* Created by Guilhem Eydieux, 5th June 2009
*/
$e = & $modx->Event;
switch ($e->name) {
case "OnBeforeDocFormSave":
//Uncomment the following line to see what field you can check
//die($_POST);
$msg = "";
if(!isset($_POST["pagetitle"]) || empty($_POST["pagetitle"]))
$msg .= "- Title\n";
if(!isset($_POST["longtitle"]) || empty($_POST["longtitle"]))
$msg .= "- Long title\n";
if(!isset($_POST["description"]) || empty($_POST["description"]))
$msg .= "- Description\n";
if(!isset($_POST["ta"]) || empty($_POST["ta"]))
$msg .= "- Content\n";
if($msg != "")
{
$id = intval($_POST['id']);
$pid = intval($_POST['parent']);
$mode = $_POST['mode'];
$url = "index.php?a=$mode" . ($mode == '27' ? "&id=" . $id : "") . ($mode == '4' ? "&pid=" . $pid : "");
$modx->manager->saveFormValues($mode);
$modx->webAlert("The following fields are required :\n".$msg,$url);
die();
}
break;
}
//?>
I hope it will help people