Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc |
— | — | @@ -735,7 +735,9 @@ |
736 | 736 | } else { |
737 | 737 | if ($allow_multiple) { |
738 | 738 | $sfgJSValidationCalls[] = "validate_multiple_mandatory_fields($sfgFieldNum)"; |
739 | | - // if it's an enum... |
| 739 | + } elseif (($form_field->template_field->is_list && $form_field->template_field->field_type == 'enumeration' && $input_type != 'listbox') || ($input_type == 'checkboxes')) { |
| 740 | + $sfgJSValidationCalls[] = "validate_mandatory_checkboxes('$input_id', '$info_id')"; |
| 741 | + // if it's not a radiobutton... |
740 | 742 | } elseif ($input_type != 'radiobutton' && $form_field->template_field->field_type != 'enumeration') { |
741 | 743 | $sfgJSValidationCalls[] = "validate_mandatory_field('$input_id', '$info_id')"; |
742 | 744 | } |
— | — | @@ -1049,30 +1051,6 @@ |
1050 | 1052 | $javascript_text .= SFFormUtils::validationJavascript(); |
1051 | 1053 | $javascript_text .= SFFormUtils::instancesJavascript($using_choosers); |
1052 | 1054 | $javascript_text .= SFFormUtils::autocompletionJavascript(); |
1053 | | - $confirm_script =<<<END |
1054 | | - // ask the user to confirm before leaving the page - due to |
1055 | | - // Javascript strangeness, the question itself is hardcoded in |
1056 | | - // English and can't be changed |
1057 | | - function confirm_text(evt) { |
1058 | | - // show this confirmation message only if the user didn't |
1059 | | - // click on a form element. |
1060 | | - // unfortunately, Internet Explorer doesn't pass in any value to |
1061 | | - // this function, so we can't tell if it was called when a user |
1062 | | - // hit "Save page", etc. - in the interest of not causing user |
1063 | | - // confusion, we'll just do nothing if the browser is IE |
1064 | | - if (typeof evt == 'undefined') { |
1065 | | - return; |
1066 | | - } |
1067 | | - if (evt.target.className != "createbox") { |
1068 | | - return "Changes to the form will not be saved."; |
1069 | | - } |
1070 | | - } |
1071 | | - window.onbeforeunload = confirm_text; |
1072 | | - |
1073 | | -END; |
1074 | | - global $sfgConfirmFormExit; |
1075 | | - if ($sfgConfirmFormExit) |
1076 | | - $javascript_text .= $confirm_script; |
1077 | 1055 | if ($free_text_was_included && $showFCKEditor > 0) { |
1078 | 1056 | $javascript_text .= SFFormUtils::mainFCKJavascript($showFCKEditor); |
1079 | 1057 | if ($showFCKEditor & (RTE_TOGGLE_LINK | RTE_POPUP)) { |