My favorites | Sign in
Project Home Downloads Issues
Project Information
Members
Featured
Downloads

HOW TO

  1. - Add "ToolPaneView=2" to the end of your form URL. E.g: "http://sharepoint/site/list/NewForm.aspx?ToolPaneView=2"
2 - Add a Content Editor Web Part (CEWP) to the bottom of the form. 3 - Open the "Source editor..." web part and paste this code into it. 4 - Insert your modifications you want to make to the form in the "runMods()" function.

COMMAND TREE

toolbar['ITEM']
.hide() .show() <TD DOM>
form['ROW LABEL']
.row
.hide() .show() <TR DOM>
.titleCell
.htmlRewrite(html) .htmlPrepend(html) .htmlAppend(html) .rename(newName) <TD DOM>
.ctrlCell
.htmlRewrite(html) .htmlPrepend(html) .htmlAppend(html) .remove(textToRemove) <TD DOM>
.ctrl
.enable() .disable() .hide() .show() .clear() .insEvent(event, function) <INPUT/TEXTAREA/SELECT DOM>

EXAMPLES

TASK - To move the 'Sub-title' text box next to the 'Title' textbox: SOLN - form['Title'].htmlAppend(form['Sub-title'].ctrlCell.innerHTML);
TASK - Hide the 'Workspace' row SOLN - form['Workspace'].row.hide();
TASK - Add form validation at user input. SOLN - row['Phone Number'].ctrl.insEvent('onBlur','isPhone(this.value)')
function isPhone(val) { if (!val.match(/\d{3}-\d{3}-\d{4}/)) { alert("Please enter a phone number:\nNNN-NNN-NNNN"); } }
TASK - Make a control read-only on the EditForm.aspx SOLN - row['Aproval Authority'].ctrl.disable();

Powered by Google Project Hosting