1 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Overriding the validateCustom() function defined in common.js
6 RTE.validateCustom = function () {
8 * @var $elm a jQuery object containing the reference
9 * to an element that is being validated.
12 if ($('select[name=item_type]').find(':selected').val() === 'RECURRING') {
13 // The interval field must not be empty for recurring events
14 $elm = $('input[name=item_interval_value]');
15 if ($elm.val() === '') {
17 alert(PMA_messages['strFormEmpty']);
21 // The execute_at field must not be empty for "once off" events
22 $elm = $('input[name=item_execute_at]');
23 if ($elm.val() === '') {
25 alert(PMA_messages['strFormEmpty']);
30 }; // end RTE.validateCustom()
33 * Attach Ajax event handlers for the "Change event type"
34 * functionality in the events editor, so that the correct
35 * rows are shown in the editor when changing the event type
37 * @see $cfg['AjaxEnable']
39 $(document).ready(function () {
40 $('select[name=item_type]').live('change', function () {
41 $('.recurring_event_row, .onetime_event_row').toggle();
43 }); // end of $(document).ready()