Index: captcha.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.admin.inc,v
retrieving revision 1.32.2.2
diff -b -u -p -r1.32.2.2 captcha.admin.inc
--- captcha.admin.inc	5 Jul 2010 21:37:21 -0000	1.32.2.2
+++ captcha.admin.inc	3 Sep 2010 09:32:06 -0000
@@ -47,7 +47,7 @@ function captcha_admin_settings() {
   $form['captcha_form_protection'] = array(
     '#type' => 'fieldset',
     '#title' => t('Form protection'),
-    '#description' => t('Select the challenge type you want for each of the listed forms (identified by their so called <em>form_id</em>\'s). You can easily add arbitrary forms with textfield at the bottom of the table or with the help of the \'%CAPTCHA_admin_links\' option below.',
+    '#description' => t('Select the challenge type you want for each of the listed forms (identified by their so called <em>form_id</em>\'s). You can easily add arbitrary forms with textfield at the bottom of the table or with the help of the \'%CAPTCHA_admin_links\' option below. Note that a form_id must consist of only alphanumeric characters and underscores.',
       array('%CAPTCHA_admin_links' => t('Add CAPTCHA administration links to forms'))
       ),
   );
@@ -238,8 +238,17 @@ function theme_captcha_admin_settings_ca
  */
 function captcha_admin_settings_validate($form, $form_state) {
   $form_id = $form_state['values']['captcha_form_id_overview']['captcha_new_captcha_point']['form_id'];
-  if (!preg_match('/^[a-z0-9_]*$/', $form_id)) {
-    form_set_error('captcha_form_id_overview][captcha_new_captcha_point][form_id', t('Illegal form_id'));
+  if (preg_match('/^[a-z0-9\-]*$/', $form_id)) {
+    form_set_error('captcha_form_id_overview][captcha_new_captcha_point][form_id', 
+      t('A form_id must consist of only alphanumeric characters and underscores. Did you mean to use <code>%form_id</code> instead?', 
+        array('%form_id' => strtr($form_id, '-', '_'))
+      )
+    ); 
+  }
+  else if (!preg_match('/^[a-z0-9_]*$/', $form_id)) {
+    form_set_error('captcha_form_id_overview][captcha_new_captcha_point][form_id', 
+      t('A form_id must consist of only alphanumeric characters and underscores.')
+    );
   }
 }
 
