Jump to content

How to append each error message


danjapro

Recommended Posts

We are getting back each error message, but it only outputs the last error message.

 

how can we append each error message to the DIV 

 

Here is the code that loops thru each error message

 

 

  
                    if(data.length > 0) {    
$.each(data, function(error_code, message ) {
if(errorCode == $.trim(message.error_code) && errorCode != -1 ){
error_message = message.message;
                           return false; 
}
    });
}
 

 

 

Here is the code that outputs the error message in a drop down. PLEASE ANY HELP

 

if(BoltNotify === true && multipleNotice === true){ 
      //var error_message += error_message; 
  var spanerrorgen = $('.error.message').contents().find('h4').html(error_message);
  var appenderrorgen = $('.error.message').contents().find('h4');
  $.each(data, function($fieldref) { 
$(spanerrorgen).append(spanerrorgen);
});
 VanillaReload.notify.showNotification(".error");                     
    }
 
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.