And also, how can I get node/terms to open target="_blank"?
<?php
function MYMODULE_form_alter(&$form, $form_state, $form_id) {
if($form_id == 'user_register') {
$form['legal'] = array(
'#type' => 'fieldset',
'#title' => t('legal'),
);
$form['legal']['select'] = array(
'#type' => 'checkbox',
'#required' => TRUE,
'#title' => t('Terms of Use<span class="form-required" title="' . t('This field is required') . '">*</span>'),
'#default_value' => 0,
'#description' => t('I certify that I am over the age of 18, and I have read and agree to the '.l('Terms of use.','node/terms').''),
);
$form['#validate'][] ='customfunctions_form_validate_custom';
}
}
function MYMODULE_form_validate_custom($form, &$form_state) {
$legal = $form_state['values']['select'];
if ($legal == 0) {
form_set_error('select', 'Please check the agreement.');
}
}
?>