manual event agent validate JSON field before form submit (#1728)

This commit is contained in:
Enfop 2016-10-11 13:53:56 +02:00 committed by Andrew Cantino
parent 005be58d30
commit 8efe50ad99

View file

@ -30,6 +30,13 @@
e.preventDefault();
var $form = $("#create-event-form");
var $status = $("#event-creation-status");
try{
JSON.parse($form.find("textarea").val());
}
catch(err){
alert ('Sorry, there appears to be an error in your JSON input. Please fix it before continuing.');
return false;
}
$.ajax({
url: $form.attr('action'),
method: "post",