mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
manual event agent validate JSON field before form submit (#1728)
This commit is contained in:
parent
005be58d30
commit
8efe50ad99
1 changed files with 7 additions and 0 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Reference in a new issue