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 - populate form field onLoad

Yelena - Wednesday, June 24, 2009 2:10 PM:

I need the help with the form event method that will populate the field onLoad.

I have several forms based on the itemtype's "classification"  and would like to populate the field with different values when the specific form is loaded.  I hope it is something very easy like:


this.setProperty("material","wood");return this;


or maybe


var itm = document.item;

var  material = itm.getProperty("material");

itm.setProperty(material,'Wood');

 


Well, neither one is working.

I will appreciate any help.

Kind Regards,



SamsAn - Wednesday, June 24, 2009 2:49 PM:

Use OnAfterNew Client Event (see corresponding tab in ItemType form) with a method having javascript like:

this.setProperty("material", "wood");
return this;

SamsAn.
Original Mind Any Level Innovator Solutions Free-Lancer, http://sites.google.com/site/caraacc



Yelena - Wednesday, June 24, 2009 3:42 PM:

Actually I wanted the value populated / changed based on the classification selected.



SamsAn - Thursday, June 25, 2009 8:26 AM:

Use OnChange classification field event, the method code should be like:

if (document.isEditMode && window.handleItemChange)
{
  window.handleItemChange("material", "wood");
}

SamsAn.
Original Mind Any Level Innovator Solutions Free-Lancer, http://sites.google.com/site/caraacc



Yelena - Thursday, June 25, 2009 4:40 PM:

Thanks, your example gave me a good idea what to do. Your help is greatly appreciated.

Kind Regards,

Yelena