Skip to content

Commit

Permalink
Fixes issue 1: Empty date range fields are not submitted with the form.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rune Kaagaard committed Nov 8, 2011
1 parent 15ea9a9 commit 5a38613
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion filtrate/static/filtrate/js/daterangefilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,19 @@
}
});

/**
* When the submit button is clicked, we disable all the __alt fields so
* they wont get submitted. We also disable fields whose alt __alt fields
* are empty.
*/
$('form.filtrate_daterange_form input[type=submit]').click(function() {
$(this).parent().find('.filtrate_date').attr('disabled', 'disabled');
$(this).parent().find('.filtrate_date_hidden').each(function() {
var datepicker = $('#' + $(this).attr('id') + '__alt');
if (datepicker.val() === "") {
$(this).attr('disabled', 'disabled');
}
datepicker.attr('disabled', 'disabled');
});
});

});})(jQuery || django.jQuery, this);
Binary file modified tests/test_project/test_db.sql
Binary file not shown.

0 comments on commit 5a38613

Please sign in to comment.