locked
Making Fields and Forms Read Only RRS feed

  • Question

  • We have done a customization that requires us to lock down a form as read only through Jscript.  However, when a user enters the form, the first field is active until they leave it, then it becomes read only.  This is the code I am using on the form onload event:

    for (var index in crmForm.all)
    {
        var control = crmForm.all[index];
        if (control.req && (control.Disabled != null))
        {
          if (control.type == "text")
              {
                  control.readOnly = true;
               }
              else
              {
                   control.disabled = true;
              }
         }
    }

    Any ideas why the first field is enabled until I move focus?

    Thanks!

    Friday, February 12, 2010 10:14 PM

Answers

All replies