So, I have a form with a default value 'You have not enabled TFA' that is editable for the user. This works, and user input is recorded in the database, but when the form is returned it shows the default value again, and I think it would be better to return the form with the inputted values.
Here is my admin.inc file:
function my_module_admin_settings_form($form, $form_state, $nid = 0){
$form = array();
$form['subject'] = array(
'#title' => t('Subject Line'),
'#descirption' => t('Default email subject line.'),
'#type' => 'textfield',
'#size' => '50',
'#required' => TRUE,
'#default_value' => variable_get('subject', 'You have not enabled TFA'),
);
...
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}
Here is the code for variable_get function (for reference):
function variable_get($name, $default = NULL) {
global $conf;
return isset($conf[$name]) ? $conf[$name] : $default;
}
Can anybody see what is going on?