Issue with Profile Builder registration shortcode inside an Elementor Pro popup
-
Hello, thanks for reading in advance!
I write because I am attempting to use the login and registration shortcodes in an Elementor Pro popup.
Main issue is, that when there is an error either during login or registration, the page is reloaded, right? With the error displaying within the login/registration format. But there is no way for the user to know that there was indeed an error in my page because the page doesn’t open WITH the popup open, where the error is being shown.I want to modify it so that if the page reloads on error, it does so with the popup open. For this I have given the popup a hashtag, it will open whenever the url has a #register at the end.
Now, onto the part that actually triggers the hash to be added, I wrote a code that checked whether the class of the error .wppb-error existed in the page, and if it did, it appended the hashtag to the url, like this:
document.addEventListener(‘DOMContentLoaded’, function() {
var errorElement = document.querySelector(‘.wppb-error’);
// Check if it’s a registration error
if (errorElement && errorElement.id === ‘wppb_form_general_message’) {
window.location.hash = ‘register’;
}
// Check if it’s a login error
else if (errorElement && !errorElement.id) {
window.location.hash = ‘login’;
}
});This is to display the Registration or Login pop ups respectively, as the register error message also has an ID:
id=”wppb_form_general_message” class=”wppb-error”
While login error doesnt, it’s just class=”wppb-error”But now, this code never executes, as the class is within a popup, it doesn’t really exist in the code of the page until the popup is opened, by that point the entire idea of the user not having to open the popup again is defeated.
So, I wanted to ask if there is perhaps any way within the plugin code to have it already include the hashtags when the person is redirected after a login or registration failure, so that I don’t have to try to append it this way, or if there is perhaps any other way to do so.
I would greatly appreciate being pointed in the direction of which are the relevant lines on the plugin that handle this redirect and I could modify it myself from there.
- The topic ‘Issue with Profile Builder registration shortcode inside an Elementor Pro popup’ is closed to new replies.