Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/04/2012, 08:57
juanaDe
 
Fecha de Ingreso: abril-2009
Mensajes: 52
Antigüedad: 15 años, 1 mes
Puntos: 0
Respuesta: enviar parámetros que se reciben con $_get

Aqui esta el código:


function theme_page(){

return drupal_get_form('theme_upload');
}

function theme_upload(){
$form['#attributes']['enctype'] = 'multipart/form-data';

$form['texto'] = array(
'#type' => 'file',
'#title' => 'Texto',
);
$form['campo'] = array(
'#type' => 'textfield',
'#default_value' => $nombreTest,
'#title' => 'Campo'
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'submit'
);

return $form;

}
function theme_upload_validate($form, &$form_state) {

$texto=$form_state['values']['texto'];

if($form_state['clicked_button']['#value'] == $form_state['values']['submit']) {
if($texto == null && $texto == ''){
form_set_error('Texto', t('El campo texto es obligatorio'));
}
}

function theme_upload_submit(&$form, &$form_state){

if($form_state['clicked_button']['#value'] == $form_state['values']['submit']){

$texto=$form_state['values']['texto'];
//-----------------LOGICA-----------------------

}
}