This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

APPLICATION - PRODUCT ENGINEERING - Enabling fields in a form

Ron - Tuesday, September 25, 2007 9:32 AM:

I have a form where thought out the workflow several users will need to add information and based on their login ID I would like to restrict which fields they can edit. The users are identified in the form and I know I can disable/enable fields, I am just not sure how to do this via method or Java script

 

Looking for ideas on controlling users ability to edit a form based on workflow activity.

 

Thanks

Ron 



SamsAn - Tuesday, September 25, 2007 12:19 PM:

Hi.

The code below hides the field. Note: like code is used in PM Solution.

var spn = getSpanByPropName("prop_name_for_field_to_hide");
if (spn) spn.style.visibility = "hidden";

function getSpanByPropName(propNm)
{
  var spans = document.getElementsByTagName("span");
  var s;
  for (var i=0; i<spans.length; i++)
  {
    s = spans[i];
    if (s.name==propNm)
    {
      return s;
    }
  }
  return null;
}

 

So, you may use this code in the form onload event. The flags to hide/display the fields may be calculated basing on IOM requests of workflow activity.

Hope it helps.