Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

When i configure to "/content/forms/af/draftsave/demostoreandretrieveformdata.html" then the page redirects but the submit button in the form does not work. Can anyone help in this issue?

Avatar

Level 3

When i configure to "/content/forms/af/draftsave/demostoreandretrieveformdata.html" then the page redirects but the submit button in the form does not work. Can anyone help in this issue?

 

function validateAJAX(email, password) {
$.ajax({
url: '/bin/userTestDraftLogin',
method: 'POST',
data: {
email: email,
password: password
},
success: function (resultText) {

console.log("success");

window.location.href = "/content/forms/af/draftsave/demostoreandretrieveformdata.html";
},
error: function (jqXHR, exception) {
alert("Invalid email or password");
console.log('Error occured!!');
}
});
}

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Based on your workaround, it appears that the issue lies with the "wcmmode" type. Although you are encountering this behavior on your Author instance, it should not pose a problem because you won't be using this implementation in an Author instance. Therefore, I'm not sure if you really want to adjust your logic to make it work in an Author instance. 

 

By default, the mode prior to the URL changes will be retained. So, if you are testing with the "PREVIEW" mode selected, the "demostoreandretrieveformdata.html" page will load in "PREVIEW" mode, where I assume your button should function correctly. If, for some reason, your button requires a "DISABLED" mode, you can simply adjust your code to append the "DISABLED" mode only if the page is loaded on an author instance. However, I wouldn't recommend investing too much time in this, as it's unlikely to be accessed in an author instance.

 

Hope this helps

 

 

 

 



Esteban Bustamante

View solution in original post

2 Replies

Avatar

Level 3

The alternate solution i found is by adding wcmmode=disabled. Is this only way to see in publish mode.

  window.location.href = "/content/forms/af/draftsave/demostoreandretrieveformdata.html?wcmmode=disabled";

Avatar

Correct answer by
Community Advisor

Based on your workaround, it appears that the issue lies with the "wcmmode" type. Although you are encountering this behavior on your Author instance, it should not pose a problem because you won't be using this implementation in an Author instance. Therefore, I'm not sure if you really want to adjust your logic to make it work in an Author instance. 

 

By default, the mode prior to the URL changes will be retained. So, if you are testing with the "PREVIEW" mode selected, the "demostoreandretrieveformdata.html" page will load in "PREVIEW" mode, where I assume your button should function correctly. If, for some reason, your button requires a "DISABLED" mode, you can simply adjust your code to append the "DISABLED" mode only if the page is loaded on an author instance. However, I wouldn't recommend investing too much time in this, as it's unlikely to be accessed in an author instance.

 

Hope this helps

 

 

 

 



Esteban Bustamante