add show form will reset the dates that you had selected if there are errors.
This commit is contained in:
parent
44c830066b
commit
f8623dfb81
|
@ -138,7 +138,6 @@ function setAddShowEvents() {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
var data = $("form").serializeArray();
|
var data = $("form").serializeArray();
|
||||||
var string = $("form").serialize();
|
|
||||||
|
|
||||||
var hosts = $('#add_show_hosts-element input').map(function() {
|
var hosts = $('#add_show_hosts-element input').map(function() {
|
||||||
if($(this).attr("checked")) {
|
if($(this).attr("checked")) {
|
||||||
|
@ -152,6 +151,9 @@ function setAddShowEvents() {
|
||||||
}
|
}
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
|
var start_date = $("#add_show_start_date").val();
|
||||||
|
var end_date = $("#add_show_end_date").val();
|
||||||
|
|
||||||
$.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
$.post("/Schedule/add-show", {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
||||||
if(json.form) {
|
if(json.form) {
|
||||||
$("#add-show-form")
|
$("#add-show-form")
|
||||||
|
@ -159,6 +161,9 @@ function setAddShowEvents() {
|
||||||
.append(json.form);
|
.append(json.form);
|
||||||
|
|
||||||
setAddShowEvents();
|
setAddShowEvents();
|
||||||
|
|
||||||
|
$("#add_show_end_date").val(end_date);
|
||||||
|
$("#add_show_start_date").val(start_date);
|
||||||
showErrorSections();
|
showErrorSections();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue