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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Set default value in i...
Power Pages
Answered

Set default value in input text box and disable doesn't capture the value when saved

(1) ShareShare
ReportReport
Posted on by 53

Hi,

 

When trying to create a record using entity form, I  preset the input text box with a default value and disable it so that user cannot change the value. However when the user submits the form, the value is not stored in the database. 

If I didn't disable the text box, it's working fine. Is there any way to resolve this?

 

Here is the code that I used to set the default value in the text box (id = pid_material)

$("#pid_material").val("Aluminium"); 
 
I also tried with this one but same result:
$("#pid_material").attr("value", "Aluminium");
 
And here is the code that I use to disable the input text box
$( "#pid_material" ).prop( "disabled", true );
 
Any helps would be appreciated.
 

Thanks,

Harry

 

Categories:
  • Verified answer
    justinburch Profile Picture
    Microsoft Employee on at

    Interesting find here, @harry_c2020 - I didn't know this worked this way. I assume it's because some aspect of portal config uses the disabled property and they want to ensure it can't be broken by simple console JS.

    Regardless, I found that I was able to make it work by switching from disabled to readonly properties.

     

    $("#pid_material").prop("readonly", true);

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
M Bilal Khan Profile Picture

M Bilal Khan 139

#2
Mohsin Ali Profile Picture

Mohsin Ali 41

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard