Skip to main content
found another problem
Source Link
iStryker
  • 4.5k
  • 2
  • 24
  • 44

Yes, but I would change

$form['#validate'][] ='customfunctions_form_validate_custom';

to

$form['#validate'][] ='MYMODULE_user_registration_form_validate';

and

function MYMODULE_form_validate_custom($form, &$form_state) {

to

function MYMODULE_user_registration_form_validate($form, &$form_state) {

Nothing wrong with your code, but this just keep with the Drupal naming convention ie search_form_validate, node_form_validate, etc

Also

'#title' => t('Terms of Use<span class="form-required" title="' . t('This field is required') . '">*</span>'),

is bad

'#title' => t('Terms of Use') . "<span class='form-required' title='" . t('This field is required') . "'>*</span>",

Yes, but I would change

$form['#validate'][] ='customfunctions_form_validate_custom';

to

$form['#validate'][] ='MYMODULE_user_registration_form_validate';

and

function MYMODULE_form_validate_custom($form, &$form_state) {

to

function MYMODULE_user_registration_form_validate($form, &$form_state) {

Nothing wrong with your code, but this just keep with the Drupal naming convention ie search_form_validate, node_form_validate, etc

Yes, but I would change

$form['#validate'][] ='customfunctions_form_validate_custom';

to

$form['#validate'][] ='MYMODULE_user_registration_form_validate';

and

function MYMODULE_form_validate_custom($form, &$form_state) {

to

function MYMODULE_user_registration_form_validate($form, &$form_state) {

Nothing wrong with your code, but this just keep with the Drupal naming convention ie search_form_validate, node_form_validate, etc

Also

'#title' => t('Terms of Use<span class="form-required" title="' . t('This field is required') . '">*</span>'),

is bad

'#title' => t('Terms of Use') . "<span class='form-required' title='" . t('This field is required') . "'>*</span>",
Source Link
iStryker
  • 4.5k
  • 2
  • 24
  • 44

Yes, but I would change

$form['#validate'][] ='customfunctions_form_validate_custom';

to

$form['#validate'][] ='MYMODULE_user_registration_form_validate';

and

function MYMODULE_form_validate_custom($form, &$form_state) {

to

function MYMODULE_user_registration_form_validate($form, &$form_state) {

Nothing wrong with your code, but this just keep with the Drupal naming convention ie search_form_validate, node_form_validate, etc