Volevo scrivere in un campo di testo un tipo e se quel tipo esistava riempire i campi di testo sotto altrimenti lasciarli vuoti cosi che l'utente potesse completarli. Il problema è che se uso #value quando ricreo la form se il campo tipo non esiste anche se scrivo un valore nei tipi nelle altre lingue non mi inserisce al submit nulla. se uso default value invece non mi carica nulla.
Vi posto il codice che ho utilizzato nelle funzioni di haha.
<?php
//creazione della form
// creazione dei campi di testo
$form['prova']=array
( '#type' => 'fieldset',
'#prefix' => '<div id="tipoalimento">',
'#suffix' => '</div>', );
$form['prova']['tipo_it'] = array
(
'#type' => 'textfield',
'#title' => t('Tipo in italiano'),
'#size' => 25,
'#maxlengh' => 200,
'#description' => t('ES: primo'),
'#required' => TRUE,
'#ahah' => array(
'path' => 'riempi/js', //sull'evento onchange viene chiamta questa pagina
'wrapper' => 'tipoalimento') );
$form ['prova']['tipo_en'] = array
(
'#type' => 'textfield',
'#title' => t('Tipo in inglese'),
'#size' => 25,
'#maxlengh' => 200,
'#description' => t(''),
'#required' => TRUE,
);
$form ['prova']['tipo_es'] = array
(
'#type' => 'textfield',
'#title' => t('Tipo in spagnolo'),
'#size' => 25,
'#maxlengh' => 200,
'#description' => t(''),
'#required' => TRUE, );
$form['prova']['tipo_sq'] = array
(
'#type' => 'textfield',
'#title' => t('Tipo di alimento in albanese'),
'#size' => 25,
'#maxlengh' => 200,
'#description' => t(''),
'#required' => TRUE, );
//creazione del bottone submit
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('invia'),
);
return $form;
}
?>