incominciando a smanettare con drupal ho scritto questo modulo
COME MAI NON MI EFFETTUA NESSUN CONTROLLO SULLA CORRETTEZA DELLA MAIL????????
<?php
function prova_modulo_menu() {
$items = array();
$items['prova_modulo/form'] = array(
'title' => t('Il mio form'),
'page callback' => 'prova_modulo_form',
'access arguments' => array('access content'),
//'description' => t('Il mio form'),
//'type' => MENU_CALLBACK,
);
return $items;
}
function prova_modulo_form() {
return drupal_get_form('prova_modulo_my_form');
}
function prova_modulo_my_form($form, &$form_submit) {
//date di pubblicazione
//contatti
$form['gruppo1'] = array(
'#type' => 'fieldset',
'#title' => t('Contatti'),
'#collapsible' => TRUE, // Added
'#collapsed' => FALSE, // Added
//'#description' => "",
);
$form['gruppo1']['Titolo'] = array(
'#type' => 'textfield',
'#size' => '120',
'#maxlength' => '100',
'#title' => t('Titolo'),
'#required' => TRUE,
);
$form['gruppo1']['EmailContatto'] = array(
'#type' => 'textfield',
'#size' => '120',
'#maxlength' => '255',
'#title' => t('Email'),
'#required' => TRUE,
);
$form['gruppo1']['TelContatto'] = array(
'#type' => 'textfield',
'#size' => '120',
'#maxlength' => '100',
'#title' => t('Telefono 1'),
);
$form['gruppo4']['Indirizzo'] = array(
'#type' => 'textfield',
'#size' => '120',
'#maxlength' => '255',
'#title' => t('Indirizzo'),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Invia'),
);
return $form;
}
/**
* Validazione indirizzo mail
*/
function prova_modulo_email_validate($form, &$form_state) {
if (!valid_email_address($form_state['values']['EmailContatto'])) {
form_set_error('EmailContatto', t('That e-mail address is not valid.'));