Hi,
I created form that show additional textfields when you check checkbox (you can see it below).
My first question: I found it working only if I wrap and refresh whole form. How can I refresh only these two textfield without using special field set. I tried with markup but with no luck.
My second question: Value of checkbox is stored in v_email_smtp_server_auth variable. When I open again these form check box is already checked but folowing textfields are not show as ajax is no executed yet. How to resolve these?
$form['email']['v_email_smtp_server_auth'] = array(
'#type' => 'checkbox',
'#title' => t('Authentication required'),
'#default_value' => variable_get('v_email_smtp_server_auth', 0),
'#description' => t('Check these option if your server need login authentication.'),
'#ajax' => array(
'callback' => '_v_ajax_admin_settings_form_callback',
'wrapper' => 'v-admin-settings-form',
'effect' => 'fade',
'progress' => array('type' => 'none'),
),
);
if (!empty($form_state['values']['v_email_smtp_server_auth']) && $form_state['values']['v_email_smtp_server_auth']) {
$form['email']['v_email_smtp_username'] = array(
'#type' => 'textfield',
'#title' => t('Username'),
'#default_value' => variable_get('v_email_smtp_username', ''),
'#size' => 30,
'#maxlength' => 50,