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

DEVELOPERS FORUM - can I enable and disable the form fields based on life cycle state?

Harsha - Monday, August 6, 2012 3:57 AM:

Hi, 

    I think my issues are little different , I have already posted 2 issues but did 't get any replies from anyone.This time I hope that some one responds and replies to my question.
    My problem is, I have created one Itemtype and its form with some 'drop down','Item' and 'text' fields. Now based on the Life cycle state of my Itemtype I should disable and enable my text fields.
   
Like if the state is 'New' one text field should be disabled and other should be enabled.


Is it possible by creating a new java script method? or any other ways to make this happen?

 Please guide me with your answers.

 Thank you all,
  Harsha



fli - Monday, October 29, 2012 7:20 AM:

Hi Harsha,

this code can be run from the formmethod tab, onFormpopulate

and will disable element with name = button1 if the Item is in "In Progress" state

 

 

Edit::

 

 

if (document.thisItem.getProperty("state","") === "In Progress")

   {

       document.forms[0].button1.disabled = true;  

   }

Regards Christoffer