Customize users frontend forms messages
Hello,
I would like to add Errors or Success messages to the page when users change their informations on their profile page (in addition of ap-notify system). I’ve tried to use this jQuery hook ‘ap_after_ajax’, but it do nothing :
$(document).on('ap_after_ajax', function(e, data) { // It do nothing console.log('ap_after_ajax'); });
How can I customize my errors or success messages for user sections forms ?
Thank you!
Oh sorry, this is not for translating the form success/errors messages. I want to append another box on top of the form after the Ajax is finish. I need to have an event when Ajax is finish and get the success or the error message to append it in this new box.
Example :
$(document).on('ap_after_ajax', function(e, data) { var message = data; $('#ap_user_profile_form').prepend('<div class="msg">'+message+'</div>'); });
How could achieve this ?
Thanks! 🙂
Rahul Aryan commented on answer
Data is Object so you cannot directly interpolate it. if you want message then use: data.message