php - Obtain form value from Drupal 6 module form while loop -
inside form hook:
$count = 1; while($slice = db_fetch_array($fruit)){ $section = $slice['section']; $form[$section][$count] = array( '#type' => $slice['type'], '#title' => $slice['title'], '#value' =>$slice['value'], //'#default_value' => $slice['default_value'], '#disabled' => $true_statement, '#size' => $slice['size'], '#description' => $slice['description'], '#options' => unserialize($slice['options']), '#prefix' => $slice['prefix'], '#suffix' => $slice['suffix'], ); $count = $count+1; }
inside save :
function student_grant_save($form, &$form_state) { $vari = $form_state['values']['2']; //or question count # 3,4,5...etc... drupal_set_message(t('hi').$vari); }
only hi gets printed. why can't see form value user imputed?
used dpm($form_state); , see have value entries blank though user entered them in.
reason 'value' entry in mysql table has question atributes, taking on 'default_value' , not letting user alter form values upon submit. there way around this?
Comments
Post a Comment