form validation again
This commit is contained in:
1 parent
ffa49fd092
commit
9ff60d2ba4
3 files changed
+10
-2
No files matched your search
@@ -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() == ""){
|
||||
$("<span class='error'>Cannot be empty.</span>").insertAfter($(this));
|
||||
$("<span class='error'> *</span>").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"){
|
||||
|
||||
Reference in new issue
Block a user