Skip to content
Andreas Scharf edited this page Sep 24, 2013 · 3 revisions

The Sponge JavaScript Forms API allows you to easily manipulate the SharePoint Standard Forms (New/Edit/Display). It supports the following field types:

  • Text (Simple / Multi / RichText)
  • Number
  • Currency
  • Checkbox
  • DateTime
  • Lookup (Single / Multi)
  • Choice (Single, Multi, Checkboxes)
  • People Picker (Single / Multi)
  • Hyperlink

###Example Usage

//gets the field object for field 'MyTextField'
var field = sponge.forms.fields("MyTextField");

//gets the value
var value = field.get();

//updates the value
field.set("MyNewValue");

//hides the field (incl. label)
field.hide();

//shows the field again
field.show();

//disables the field
field.disable();

//additional properties
var type = field.type(); //gets the type of the field
var row = field.row(); //gets the row (parent, mostly TR)
var data = field.data; //gets the data (jQuery object)

All those methods / properties can be used for any field type!

Back to JavaScript API.