Hello
there something I don't get in forms API.
When I create the form like below, the link test/modify is used to show up the form, but when I hit ok
I am redirected whith the same link which reinitialize the form and only after that the submit procedure is called
with empty values.
I've tried to move on myself in the forums but I don't find any suggestion.
Thank you for help !!!
jj cambefort
function test_form_proc() {
$form = array();
$form[ 'test' ] = array (
'#type' => 'textfield',
'#size' => 40,
'#maxlength' => 8,
'#title' => 'test',
'#value' => "{$edit[ 'test' ]}",
);
$form[ 'societe' ] = array (
'#type' => 'textfield',
'#size' => 40,
'#maxlength' => 30,
'#title' => 'societe',
'#value' => "{$edit[ 'societe' ]}",
);
$form[ 'submit' ] = array (
'#type' => 'submit',
'#value' => 'ok',
'#submit' => TRUE,
);
return $form;
}
function test_form() {
return drupal_get_form( 'test_form_proc' );
}
function test_form_proc_submit( $form_id,$form_values ) {
return 'test';
}
function test_page() {
$fonction = arg( 1 );
switch ( $fonction ) {
case 'modify':
$output = test_form();
break;
default:
$link_modify = l( 'modify',"test/modify",array( 'title'=>'modify') );