Adjusted date validation error
This commit is contained in:
parent
6e10721adf
commit
274eb17e8b
1 changed files with 12 additions and 0 deletions
|
|
@ -264,6 +264,16 @@ function validateStartTime() {
|
|||
}
|
||||
}
|
||||
|
||||
function removeInvalidDate() {
|
||||
var single_event_date = document.getElementById("single_event_date");
|
||||
if (single_event_date.classList.contains("red_border"))
|
||||
{
|
||||
single_event_date.value = "";
|
||||
$(single_event_date).next().hide();
|
||||
$(single_event_date).removeClass("red_border");
|
||||
}
|
||||
}
|
||||
|
||||
function isValidDate(date) {
|
||||
if (date === "") return true;
|
||||
var matches = /^(\d+)[-\/](\d+)[-\/](\d+)$/.exec(date);
|
||||
|
|
@ -310,6 +320,8 @@ $(document).ready(function () {
|
|||
$(".finish_time").change(validateFinishTime);
|
||||
$(".start_time").change(validateStartTime);
|
||||
|
||||
$("#event_type_recurrent").change(removeInvalidDate);
|
||||
|
||||
var radioValue = $("input[name='event_type']:checked");
|
||||
if (radioValue.val()) {
|
||||
require_fields(radioValue.get(0));
|
||||
|
|
|
|||
Loading…
Reference in a new issue