Wednesday, December 2, 2009

Moving of field - Dynamically

I have used JavaScript to move the field from a section in the form to another section in the same form

//the target location - next to which field
var searchEl = document.getElementById("transactioncurrencyid_d");
//the source _c
var ele_c = document.getElementById("estimatedclosedate_d").nextSibling;
//the source _d
var ele_d = document.getElementById("opportunityratingcode_c").nextSibling;
//move the fields
searchEl.nextSibling.appendChild(ele_c);
searchEl.nextSibling.nextSibling.appendChild(ele_d);

In the above example i am moving the Rating field from the Estimated Revenue section to the Opportunity Information section - next to the Currency Field(Target Location)

No comments:

Post a Comment