Client-Side form validation issue with Fivestar module?
Perhaps you are using the wrong $form_id

One way to check is to use Database Logging, also known as the Watchdog or Recent Log Entries, to log the $form_id. After you add this code, execute the form by performing a submit, and then check your Reports > Recent Log Entries area for the result. This may require enabling the Database Logging core module before the messages are logged and/or visible.

&lt;?php
/**
 * Implementation of hook_form_alter()
 */
function rishihrvalidate_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  // Log the $form_id to the watchdog
  // in this example, 'form_id' is just the log entry name. I commonly use 'wtf'
  watchdog('form_id', $form_id);

  if ($form_id == 'comment_form') {
    $form['#attributes']['onsubmit'] = 'return comment_cs_validate()';
  }
}
?&gt;


For more information about watchdog, visit http://api.drupal.org/api/function/watchdog