Index: captcha.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/captcha/captcha.admin.inc,v
retrieving revision 1.32.2.2
diff -u -r1.32.2.2 captcha.admin.inc
--- captcha.admin.inc	5 Jul 2010 21:37:21 -0000	1.32.2.2
+++ captcha.admin.inc	4 Sep 2010 02:06:26 -0000
@@ -47,8 +47,8 @@
   $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.',
-      array('%CAPTCHA_admin_links' => t('Add CAPTCHA administration links to forms'))
+    '#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 may only contain lowercase alphanumeric characters and underscores (no spaces, no hyphens).',
+       array('%CAPTCHA_admin_links' => t('Add CAPTCHA administration links to forms'))
       ),
   );
   $form['captcha_form_protection']['captcha_default_challenge'] = array(
@@ -238,8 +238,17 @@
  */
 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'));
+  // Start by assuming the user did the right thing.
+  if (preg_match('/^[a-z0-9_]*$/', $form_id)) {
+    return;
+  }
+  // Check if the user used hyphens and/or uppercase text.
+  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 may only contain lowercase alphanumeric characters and underscores. You entered %form_id, did you mean to use %suggested_id instead?', array('%form_id' => $form_id, '%suggested_id' => strtolower(strtr($form_id, '-', '_')))));
+  }
+  // User entered something totally wrong.
+  else {
+    form_set_error('captcha_form_id_overview][captcha_new_captcha_point][form_id', t('A form_id may only contain lowercase alphanumeric characters and underscores.'));
   }
 }
 
