diff --git a/app/assets/javascripts/ajax_form.js b/app/assets/javascripts/ajax_form.js index f627ac85..065e09fd 100644 --- a/app/assets/javascripts/ajax_form.js +++ b/app/assets/javascripts/ajax_form.js @@ -26,14 +26,17 @@ $(document).on('click', '#ajax_form_submit', function(){ beforeSubmit: function(){ var sub = true; $("span.error").remove(); + $("#dyn_error").empty(); $("#ajaxForm input").each(function(){ if($(this).val() == ""){ - $("Cannot be empty.").insertAfter($(this)); + $(" *").insertAfter($(this)); sub = false; } }) - if(!sub) + if(!sub){ + $("#dyn_error").text("Cannot be empty."); return false; + } }, success: function(response,status,xhr){ if(typeof tinyMCEPopup != "undefined"){ diff --git a/app/assets/stylesheets/message.css b/app/assets/stylesheets/message.css index 7206bd72..ffa954f1 100644 --- a/app/assets/stylesheets/message.css +++ b/app/assets/stylesheets/message.css @@ -11,3 +11,7 @@ .warning{ color:orange; } +label#dyn_error { + + margin-left: 50%; +} \ No newline at end of file diff --git a/app/views/admin/assets/file_upload.html.erb b/app/views/admin/assets/file_upload.html.erb index f1313eeb..5e19a1ad 100644 --- a/app/views/admin/assets/file_upload.html.erb +++ b/app/views/admin/assets/file_upload.html.erb @@ -9,6 +9,7 @@