test disabling save button

This commit is contained in:
Nathan Coad
2018-05-22 12:34:46 +10:00
parent 93881117e8
commit 5054a241b0

View File

@@ -340,6 +340,7 @@ function booking_emails_custom_ajax_form($node, &$form_state) {
$form['submit'] = array( $form['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Save'), '#value' => t('Save'),
'#disabled' => TRUE,
); );
return array ( return array (
@@ -368,10 +369,12 @@ function booking_emails_custom_ajax_form_callback($form, &$form_state) {
//watchdog('booking_debug', 'custom text: <pre>@info</pre>', array('@info' => print_r( $text, true))); //watchdog('booking_debug', 'custom text: <pre>@info</pre>', array('@info' => print_r( $text, true)));
// TODO : Figure out what this should be if HTML emails are NOT enabled // TODO : Figure out what this should be if HTML emails are NOT enabled
$form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = $text; $form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = $text;
$form['form']['submit']['#disabled'] = FALSE;
} }
else { else {
$form['form']['email-definition']['booking_email_subjectline_custom']['#value'] = ''; $form['form']['email-definition']['booking_email_subjectline_custom']['#value'] = '';
$form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = ''; $form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = '';
$form['form']['submit']['#disabled'] = TRUE;
} }
//watchdog('booking_debug', 'booking_emails_custom_ajax_form_callback: <pre>@info</pre>', array('@info' => print_r( $form, true))); //watchdog('booking_debug', 'booking_emails_custom_ajax_form_callback: <pre>@info</pre>', array('@info' => print_r( $form, true)));