I'm trying to build a password reset form for logged in users to my site. I've set this up with an adaptive form, added rules for validation with new and confirm fields that must match and meet our defined password guidelines. Using Adobe Experience Manager Help | Posting Adobe Experience Manager Form Data to Custom Services I've created a custom submit action that calls my service and will update the user's password if the current password is correct.
Unfortunately, if the current password is incorrect, the form still takes the user to the confirmation page. I've been able to modify my service to return a message, but I'm not sure how to handle this in the custom submit action to return it to the user or prevent the thank you message or page from loading.
I've read through articles on using AJAX to call a custom servlet to process a form, but all of the tutorials are building these forms in JSP, not using the adaptive forms. I haven't found anything that seems to directly address AJAX with an adaptive form in enough detail to tell me where I'd put the AJAX call. Would this go in the custom submit action JSP file or a separate JS file that's pulled in with the form's Client Library Category field? I saw a reference somewhere to putting an AJAX call into the rules editor, but that didn't seem to be the smartest move to me.
I'm sorry if this seems like a silly question. I don't have a Java background, and I've only been working with AEM for about a month.
Thanks for any help.