web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Suggested answer

Issue with read-only choice fields on multi-step form

(1) ShareShare
ReportReport
Posted on by 4

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).







Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,215 Super User 2025 Season 2 on at
    Issue with read-only choice fields on multi-step form
     

    1. Force Full Postback on Validation Failure

    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.

    2. Reinitialize JavaScript Manually

    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.

    3. Avoid Read-Only Choice Fields

    If feasible, replace read-only Choice fields with Text fields that display the selected value. This avoids the rendering issues while preserving the information.

    4. Use Web Resources for Script Loading

    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.

    5. Custom Validation Handling

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#2
Lucas001 Profile Picture

Lucas001 48 Super User 2025 Season 2

#3
KevinGador Profile Picture

KevinGador 44 Super User 2025 Season 2