We are currently facing a critical issue with our multi-step form, where we have implemented an OOTB reCAPTCHA on the last step of the form. This step is in edit mode and contains several read-only fields, along with a few editable fields. The problem arises when the reCAPTCHA or another field fails to validate.
The partial postback seems to prevent the read-only fields from reloading, and it also causes some JavaScript files, which are necessary for functionality, to not load properly.
This issue is a major blocker for our project, which is scheduled to go live at the end of this month.
Any help or guidance on how to resolve this issue would be greatly appreciated.
-----------------------------------------------------------------
I created a very simple form in the same environment with the same settings (it doesn’t have any JavaScripts).
What I found is that this issue specifically occurs with fields that have the "Choice" datatype (set to read-only).
If possible, configure the form to trigger a full postback instead of a partial one when validation fails. This ensures all scripts and fields reload properly.
After postback, use a script like this to reinitialize necessary components:
Sys.Application.add_load(function () {
// Reinitialize your scripts here
initializeChoiceFields();
initializeRecaptcha();
});
Make sure initializeChoiceFields()
handles read-only rendering correctly.
If feasible, replace read-only Choice fields with Text fields that display the selected value. This avoids the rendering issues while preserving the information.
Instead of relying on automatic script loading, embed your JavaScript as a Web Resource and load it explicitly using:
$.getScript("/WebResources/your_script_name.js", function () {
// Callback after script is loaded
});
This ensures the script loads even after partial postbacks.
Intercept validation errors and handle them gracefully to avoid triggering problematic postbacks:
formContext.data.entity.addOnSave(function (context) {
var eventArgs = context.getEventArgs();
if (!isRecaptchaValid()) {
eventArgs.preventDefault();
showRecaptchaError();
}
});
🏷️ Tag me if you have any further questions or if the issue persists.
✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
❤️ Give it a Like if you found the approach useful in any way.
Fubar
62
Super User 2025 Season 2
Lucas001
48
Super User 2025 Season 2
KevinGador
44
Super User 2025 Season 2