? files ? formcheck.patch ? misc/formcheck.js ? modules/devel.module Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.476 diff -u -r1.476 common.inc --- includes/common.inc 31 Aug 2005 18:37:30 -0000 1.476 +++ includes/common.inc 15 Sep 2005 22:42:54 -0000 @@ -1037,6 +1037,13 @@ if (!$action) { $action = request_uri(); } + + // If the 'formcheck' class has been set, add needed javascript. + if (is_array($attributes) && array_key_exists('class', $attributes) && strpos($attributes['class'], 'formcheck')) { + drupal_add_js('misc/formcheck.js'); + $attributes['onsubmit'] = 'formcheckIsSubmit=true;' . $attributes['onsubmit']; + } + // Anonymous div to satisfy XHTML compliancy. return '
\n
". $form ."\n
\n"; } Index: modules/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node.module,v retrieving revision 1.527 diff -u -r1.527 node.module --- modules/node.module 2 Sep 2005 02:11:41 -0000 1.527 +++ modules/node.module 15 Sep 2005 22:35:53 -0000 @@ -1409,6 +1409,7 @@ if (is_array($param['options'])) { $attributes = array_merge($param['options'], $attributes); } + $attributes['class'] .= ' formcheck'; return form($output, ($param['method'] ? $param['method'] : 'post'), $param['action'], $attributes); }