Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Answered

Disable changing and deletion option for Form's File field

(0) ShareShare
ReportReport
Posted on by 105

Have set the File field to be read-only on the Form design:

jwnz_1-1670360668333.png

But the File field on the web page still allows to change and delete:

jwnz_2-1670360796758.png

How to disable change and delete options to make the File field read-only (still allow the user to click the file to download)?

 

Categories:
  • Verified answer
    oliver.rodrigues Profile Picture
    9,315 Most Valuable Professional on at
    Re: Disable changing and deletion option for Form's File field

    Are you making your customizations via Portal Management App or Portal Studio? 

     

    If using the Portal management app, you can open your form, navigate to Additional Settings and place the code in the Custom JavaScript area:

     

    OliverRodrigues_0-1670491155227.png

    $(document).ready(function () {
    
     SetFileColumnReadOnly("cr285_filecolumn");
    });
    
    function SetFileColumnReadOnly(columnName) {
     $("#" + columnName).parent().remove(); // or .hide() if you want to control dynamically
     $("#" + columnName + "_delete_button").parent().remove(); // or .hide() if you want to control dynamically
    };

     

  • jwnz Profile Picture
    105 on at
    Re: Disable changing and deletion option for Form's File field

    Hi @OliverRodrigues thanks for sending feedback to MS.

    Initially I was thinking to add JavaScript code to hide these buttons, but couldn't figure out where to add the code, would you mind to show me where to edit the form's JavaScript  code?

  • oliver.rodrigues Profile Picture
    9,315 Most Valuable Professional on at
    Re: Disable changing and deletion option for Form's File field

    Hi, thanks for reporting this, I was able to reproduce and send this to Microsoft. I will let you know once I hear back from them.

    It seems to be a bug, if you need this fixed urgently, I suggest adding JavaScript logic to remove the Browse/Delete button

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43