I did it and check only read but but still able to write.
thanks
How to make text box readonly
-
- User
- Posts: 51
How to make text box readonly
-
- User
- Posts: 11729
Please note if you enable ReadOnly option under Fields setup -> Edit Page, then it will only affect to Edit Page.
In Add/Copy Page, the Textbox is still writable. If you want to make it Read Only for Add/Copy then you may put this code in Row_Rendered server event:
if (CurrentPageID() == "add")
$this->YourFiledName->ReadOnly = true; // adjust YourFieldName to your actual field name
However, sometimes you need to define the default value for that field even you set ReadOnly to it. So, you may need this code in Row_Inserting server event:
// adjust YourFieldName to your actual field name
$rsnew["YourFieldName"] = "your default value"; // <-- adjust to your needs