Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/05/2011, 11:30
juanaDe
 
Fecha de Ingreso: abril-2009
Mensajes: 52
Antigüedad: 15 años, 1 mes
Puntos: 0
Respuesta: Problemas con la creacion de formulario en drupal 6.2

Ese es mi test.module:

function test_menu() {
$items[$path.formulario] = array(
'title' => 'formulario',
'page callback' => 'drupal_get_form',
//'page callback' => 'test_formulario',
'access callback' => TRUE,
'access arguments' => array('content type'),
'type' => MENU_CALLBACK,
);
return $items;
}



/**
* Crear el formulario
*/
function test_formulario ()
{

$form = array();
$form['test'] [ 'upload' ] = array(
'#type' => 'file' ,
'#title' => t ( 'Adjuntar Test' ),
'#size' => 40,
'#required' => TRUE,
'#weight' => -5,
'#default_value' => $rep->test,
);
$form['submit'] = array(
'#type' => 'submit',
'#name' => 'submit',
'#value' => t('Enviar'),
//'#submit' => array('test_formulario_submit'),
// '#action' => url('test_formulario_submit'),
);
$form['#submit'][] = 'test_formulario_submit';
// return drupal_render($form);
return $form;
}

function deliver_and_test_page(){
return drupal_get_form('test_formulario');
}
function test_formulario_submit ( $form, $form_state )
{

$nombre = $form_state['nombre'];
echo($nombre);
drupal_set_message ( t ( "Submit formulario" ) )

}

Me aparece una pantalla en blanco con un texto que pone "Array" que representa el objeto form. He hecho varias pruebas y no me funciona ninguna :S.

Gracias por la ayuda