change submit button disabled logic
This commit is contained in:
@@ -278,11 +278,13 @@ function booking_emails_custom_ajax_form($node, &$form_state) {
|
||||
if (!isset($form_state['input']['email-type'])) {
|
||||
$subject_value = "";
|
||||
$body_value = "";
|
||||
$submit_button_disabled = TRUE;
|
||||
}
|
||||
else {
|
||||
$emailtype = $form_state['input']['email-type'];
|
||||
$subject_value = $form_state['input']['booking_email_subjectline_custom'];
|
||||
$body_value = $form_state['input']['booking_email_body_custom']['value'];
|
||||
$submit_button_disabled = FALSE;
|
||||
}
|
||||
|
||||
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||
@@ -340,7 +342,7 @@ function booking_emails_custom_ajax_form($node, &$form_state) {
|
||||
$form['submit'] = array(
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Save'),
|
||||
'#disabled' => TRUE,
|
||||
'#disabled' => $submit_button_disabled,
|
||||
);
|
||||
|
||||
return array (
|
||||
@@ -369,12 +371,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)));
|
||||
// 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']['submit']['#disabled'] = FALSE;
|
||||
//$form['form']['submit']['#disabled'] = FALSE;
|
||||
}
|
||||
else {
|
||||
$form['form']['email-definition']['booking_email_subjectline_custom']['#value'] = '';
|
||||
$form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = '';
|
||||
$form['form']['submit']['#disabled'] = TRUE;
|
||||
//$form['form']['submit']['#disabled'] = TRUE;
|
||||
}
|
||||
|
||||
watchdog('booking_debug', 'booking_emails_custom_ajax_form_callback: <pre>@info</pre>', array('@info' => print_r( $form, true)));
|
||||
|
Reference in New Issue
Block a user