Skip to content

How i can make a MakeReadOnly() field Editable again ? #53

@johnHappy123

Description

@johnHappy123

I am facing this problem when using SPUtility.js inside my SP 2013 on-premises, now i want to do the following inside my sharepoint 2013 list forms:-

  1. Set a Choice field as ReadOnly.
  2. then chnage the value of the ReadOnly Choice field using SPUtility or pure JavaScript.

now to make my Choice field ReadOnly i use the following SPUtility method:-

SPUtility.GetSPFieldByInternalName('OrderStatus').MakeReadOnly();

but when i tired to change the value of the list after making it ReadOnly, as follow:-

SPUtility.GetSPFieldByInternalName('OrderStatus').SetValue("In Progress");

OR using pure javascript appraoch as follow:-

$('[id^="OrderStatus"]').val("In Progress");

i was unable to change the status value? so can anyone adivce how i can handle this problem? so i can change the value of a ReadOnly list?
second point, is there a way i can temporary remove the MakeReadOnly() effect on the field? if this is possible , then i can remove the ReadOnly effect on the Choice field, then set its value, then make it as ReadOnly again ?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions