SlideShare a Scribd company logo
SPTechCon San Fransicso 2014
Using jQuery to Maximize SharePoint Form
Usability
Mark.Rackley@capSpire.com
April, Twenty Fourteen
Mark Rackley / Senior Consultant
• 19+ years software
architecture and development
experience
• SharePoint Junkie since 2007
• Event Organizer
• Blogger, Writer, Speaker
• Bacon aficionado
@mrackley
www.SharePointHillbilly.com
www.MarkRackley.net
www.SharePointaLooza.org
Agenda
• What’s and Why’s
• The Basics
• Automatic Parent / Child relationship
• Showing / Hiding Fields
• Custom field validation
• Using REST for cascading drop down lists
• Improving form layout using HTML Templates
What Exactly Are We Going To Be Doing?
Create powerful dynamic forms
Create visually appealing forms
Use HTML, JavaScript
Utilize existing default New and Edit Forms
Why Are We Doing This?
Default SharePoint Forms are ugly
Default SharePoint Forms aren’t dynamic
Creating new forms from scratch is time
consuming and cumbersome
InfoPath is not the right approach for many
scenarios (and it’s going away yay!)
What Skills Do I Need?
HTML / CSS
 Create Pretty forms
JavaScript / jQuery
 Create dynamic forms
REST / CSOM / SPServices
 Create powerful forms
The Basis
Create a script and place it in a Document
Library
Edit the Default New or Edit Form for a
List/Library
Add a Content Editor Web Part to the default
form
Link Script to the Content Editor Web Part
The Basics – Editing the Default Form
From a list view on the
ribbon, click on the “List”
tab
Click on the “Modify
Form Web Parts” button
and select the form to
edit.
The Basics – Identifying Form Elements
Use the “title” attribute when possible to
retrieve a field
 <select title="City" id="City_310b7c27-13ba-4a7e-
a133-058d312a6b7f_$LookupField">
 $(“select*title=‘City’+”);
 Be careful of DOM changes (ie “Required Fields)
 <select title="City Required Field" id="City_310b7c27-
13ba-4a7e-a133-058d312a6b7f_$LookupField">
The Basics – Identifying Form Elements
Use the “FieldName” or “FieldInternalName”
stored in the comments if necessary
 <td width="350" class="ms-formbody" valign="top">
<!-- FieldName="City" FieldInternalName="City"
FieldType="SPFieldLookup“ -->
 $("table.ms-formtable td").each(function(){
if (this.innerHTML.indexOf('FieldName=“City"') != -1)
{
var field = this;
}
});
The Basic – Interacting with basic form fields
//get input / select values
$(“select*title=‘City’+”).val();
//set input / select values
$(“select*title=‘City’+”).val(“value”);
//uncheck a check box
$(“input*title=‘City’+").removeAttr('checked');
//check a check box
$(“input*title=‘City’+").attr('checked','checked');
//is a check box checked?
if ($(“input*title=‘City’+”).is(':checked'))
Showing / Hiding Fields
Show/Hide the field’s entire row to ensure the label is
not visible
 $(“select*title=‘City’+”).closest(“tr”).hide();
Attach to click event of field to trigger showing/hiding
 $(“input*title=‘myCheckbox’+”).click(function()
{
if ($(this).is(‘:checked’))
{
hide or show fields
}
});
Demo: Add jQuery to default form and learn
how to identify elements
Demo: Automatic Parent / Child List
Relationship
Demo: Showing / Hiding fields when a check
box is checked
Demo: Custom Field Validation
Demo: Using REST for Cascading Drop Down
Lists
Demo: Improving Form Layout using HTML
Templates
April, Twenty Fourteen

More Related Content

What's hot (20)

PPTX
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
Mark Rackley
 
PPTX
Intro to SharePoint Web Services
Mark Rackley
 
PPTX
(Updated) SharePoint & jQuery Guide
Mark Rackley
 
PPTX
SharePoint & jQuery Guide - SPSTC 5/18/2013
Mark Rackley
 
PPTX
SPTechCon 2014 How to develop and debug client side code in SharePoint
Mark Rackley
 
PPTX
SharePoint & jQuery Guide - SPSNashville 2014
Mark Rackley
 
PPTX
Introduction to using jQuery with SharePoint
Rene Modery
 
PPTX
Transform SharePoint default list forms with HTML, CSS and JavaScript
John Calvert
 
PPTX
SPSNH 2014 - The SharePoint & jQueryGuide
Mark Rackley
 
PPTX
SharePoint REST vs CSOM
Mark Rackley
 
PPTX
Transform SharePoint List Forms with HTML and CSS
John Calvert
 
PPTX
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 
PPTX
Content by query web part
IslamKhattab
 
PPTX
SharePoint 2013 Client Side Rendering
Bill Wolff
 
PDF
SPSSTHLM - Using JSLink and Display Templates for ITPros
Paul Hunt
 
PPTX
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
PPTX
Getting The Most Out Of SP Search SPSTC
John Ross
 
PPTX
SEF2013 - A jQuery Primer for SharePoint
Marc D Anderson
 
PPTX
O365 Saturday - Deepdive SharePoint Client Side Rendering
Riwut Libinuko
 
PPTX
Using js link and display templates
Paul Hunt
 
#SPSTC Maximizing the SharePoint User Experience with Free 3rd Party jQuery L...
Mark Rackley
 
Intro to SharePoint Web Services
Mark Rackley
 
(Updated) SharePoint & jQuery Guide
Mark Rackley
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
Mark Rackley
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
Mark Rackley
 
SharePoint & jQuery Guide - SPSNashville 2014
Mark Rackley
 
Introduction to using jQuery with SharePoint
Rene Modery
 
Transform SharePoint default list forms with HTML, CSS and JavaScript
John Calvert
 
SPSNH 2014 - The SharePoint & jQueryGuide
Mark Rackley
 
SharePoint REST vs CSOM
Mark Rackley
 
Transform SharePoint List Forms with HTML and CSS
John Calvert
 
Introduction to Client Side Dev in SharePoint Workshop
Mark Rackley
 
Content by query web part
IslamKhattab
 
SharePoint 2013 Client Side Rendering
Bill Wolff
 
SPSSTHLM - Using JSLink and Display Templates for ITPros
Paul Hunt
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
Mark Rackley
 
Getting The Most Out Of SP Search SPSTC
John Ross
 
SEF2013 - A jQuery Primer for SharePoint
Marc D Anderson
 
O365 Saturday - Deepdive SharePoint Client Side Rendering
Riwut Libinuko
 
Using js link and display templates
Paul Hunt
 

Similar to Using jQuery to Maximize Form Usability (20)

PPTX
Quick & Easy SharePoint Forms with StratusForms
April Dunnam
 
PPTX
The SharePoint & jQuery Guide
Mark Rackley
 
PPTX
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
SPTechCon
 
PPT
Introducing the JotSpot Data Model and API
Scott McMullan
 
PPT
User Profiles: I Didn't Know I Could Do That (Updated Demo)
Stacy Deere
 
PPTX
Your SharePoint 2013 Branding Initiation
Eric Overfield
 
PPTX
Intro to InfoPath Workflow
Nikkia Carter
 
PPTX
Designing SharePoint 2010 for Business
Kanwal Khipple
 
PPTX
Let's build an adoption centre in office 365
Joanne Klein
 
PPT
Share Point
jimbelo
 
PPT
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 
PPTX
Column Formatter in SharePoint Online
Mark Rackley
 
PPTX
Where did design view go in SharePoint Designer
Patrick O'Toole
 
PPTX
SharePoint and jQuery Essentials
Mark Rackley
 
PPTX
SharePoint Saturday Belgium 2014 - Using JSLink and Display Templates with th...
BIWUG
 
PPTX
PowerApps vs InfoPath - SPSVB 2019
Nikkia Carter
 
PPTX
SPSTC - SharePoint & jQuery Essentials
Mark Rackley
 
PPTX
SUGUK Cambridge - Display Templates & JSLink for IT Pros
Paul Hunt
 
PPTX
Spsbe using js-linkanddisplaytemplates
Paul Hunt
 
DOCX
How to create site content types in share point online and descrption
Prashant Kumar Singh
 
Quick & Easy SharePoint Forms with StratusForms
April Dunnam
 
The SharePoint & jQuery Guide
Mark Rackley
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
SPTechCon
 
Introducing the JotSpot Data Model and API
Scott McMullan
 
User Profiles: I Didn't Know I Could Do That (Updated Demo)
Stacy Deere
 
Your SharePoint 2013 Branding Initiation
Eric Overfield
 
Intro to InfoPath Workflow
Nikkia Carter
 
Designing SharePoint 2010 for Business
Kanwal Khipple
 
Let's build an adoption centre in office 365
Joanne Klein
 
Share Point
jimbelo
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
Kiril Iliev
 
Column Formatter in SharePoint Online
Mark Rackley
 
Where did design view go in SharePoint Designer
Patrick O'Toole
 
SharePoint and jQuery Essentials
Mark Rackley
 
SharePoint Saturday Belgium 2014 - Using JSLink and Display Templates with th...
BIWUG
 
PowerApps vs InfoPath - SPSVB 2019
Nikkia Carter
 
SPSTC - SharePoint & jQuery Essentials
Mark Rackley
 
SUGUK Cambridge - Display Templates & JSLink for IT Pros
Paul Hunt
 
Spsbe using js-linkanddisplaytemplates
Paul Hunt
 
How to create site content types in share point online and descrption
Prashant Kumar Singh
 
Ad

More from Mark Rackley (10)

PPTX
SharePoint Conference North America - Converting your JavaScript to SPFX
Mark Rackley
 
PPTX
A Power User's Introduction to jQuery Awesomeness in SharePoint
Mark Rackley
 
PPTX
Utilizing jQuery in SharePoint: Get More Done Faster
Mark Rackley
 
PPTX
Citizen Developers Intro to jQuery Customizations in SharePoint
Mark Rackley
 
PPTX
A Power User's intro to jQuery awesomeness in SharePoint
Mark Rackley
 
PDF
NOW I Get it!! What SharePoint IS and why I need it
Mark Rackley
 
PPTX
What is SharePoint Development??
Mark Rackley
 
PPTX
Wrapping your head around the SharePoint Beast (For the rest of us)
Mark Rackley
 
PPTX
What IS SharePoint Development?
Mark Rackley
 
PPTX
SharePoint Cincy 2012 - jQuery essentials
Mark Rackley
 
SharePoint Conference North America - Converting your JavaScript to SPFX
Mark Rackley
 
A Power User's Introduction to jQuery Awesomeness in SharePoint
Mark Rackley
 
Utilizing jQuery in SharePoint: Get More Done Faster
Mark Rackley
 
Citizen Developers Intro to jQuery Customizations in SharePoint
Mark Rackley
 
A Power User's intro to jQuery awesomeness in SharePoint
Mark Rackley
 
NOW I Get it!! What SharePoint IS and why I need it
Mark Rackley
 
What is SharePoint Development??
Mark Rackley
 
Wrapping your head around the SharePoint Beast (For the rest of us)
Mark Rackley
 
What IS SharePoint Development?
Mark Rackley
 
SharePoint Cincy 2012 - jQuery essentials
Mark Rackley
 
Ad

Recently uploaded (20)

PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
“A Re-imagination of Embedded Vision System Design,” a Presentation from Imag...
Edge AI and Vision Alliance
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PDF
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
Fwdays
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
“A Re-imagination of Embedded Vision System Design,” a Presentation from Imag...
Edge AI and Vision Alliance
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 

Using jQuery to Maximize Form Usability

  • 1. SPTechCon San Fransicso 2014 Using jQuery to Maximize SharePoint Form Usability Mark.Rackley@capSpire.com April, Twenty Fourteen
  • 2. Mark Rackley / Senior Consultant • 19+ years software architecture and development experience • SharePoint Junkie since 2007 • Event Organizer • Blogger, Writer, Speaker • Bacon aficionado @mrackley www.SharePointHillbilly.com www.MarkRackley.net www.SharePointaLooza.org
  • 3. Agenda • What’s and Why’s • The Basics • Automatic Parent / Child relationship • Showing / Hiding Fields • Custom field validation • Using REST for cascading drop down lists • Improving form layout using HTML Templates
  • 4. What Exactly Are We Going To Be Doing? Create powerful dynamic forms Create visually appealing forms Use HTML, JavaScript Utilize existing default New and Edit Forms
  • 5. Why Are We Doing This? Default SharePoint Forms are ugly Default SharePoint Forms aren’t dynamic Creating new forms from scratch is time consuming and cumbersome InfoPath is not the right approach for many scenarios (and it’s going away yay!)
  • 6. What Skills Do I Need? HTML / CSS  Create Pretty forms JavaScript / jQuery  Create dynamic forms REST / CSOM / SPServices  Create powerful forms
  • 7. The Basis Create a script and place it in a Document Library Edit the Default New or Edit Form for a List/Library Add a Content Editor Web Part to the default form Link Script to the Content Editor Web Part
  • 8. The Basics – Editing the Default Form From a list view on the ribbon, click on the “List” tab Click on the “Modify Form Web Parts” button and select the form to edit.
  • 9. The Basics – Identifying Form Elements Use the “title” attribute when possible to retrieve a field  <select title="City" id="City_310b7c27-13ba-4a7e- a133-058d312a6b7f_$LookupField">  $(“select*title=‘City’+”);  Be careful of DOM changes (ie “Required Fields)  <select title="City Required Field" id="City_310b7c27- 13ba-4a7e-a133-058d312a6b7f_$LookupField">
  • 10. The Basics – Identifying Form Elements Use the “FieldName” or “FieldInternalName” stored in the comments if necessary  <td width="350" class="ms-formbody" valign="top"> <!-- FieldName="City" FieldInternalName="City" FieldType="SPFieldLookup“ -->  $("table.ms-formtable td").each(function(){ if (this.innerHTML.indexOf('FieldName=“City"') != -1) { var field = this; } });
  • 11. The Basic – Interacting with basic form fields //get input / select values $(“select*title=‘City’+”).val(); //set input / select values $(“select*title=‘City’+”).val(“value”); //uncheck a check box $(“input*title=‘City’+").removeAttr('checked'); //check a check box $(“input*title=‘City’+").attr('checked','checked'); //is a check box checked? if ($(“input*title=‘City’+”).is(':checked'))
  • 12. Showing / Hiding Fields Show/Hide the field’s entire row to ensure the label is not visible  $(“select*title=‘City’+”).closest(“tr”).hide(); Attach to click event of field to trigger showing/hiding  $(“input*title=‘myCheckbox’+”).click(function() { if ($(this).is(‘:checked’)) { hide or show fields } });
  • 13. Demo: Add jQuery to default form and learn how to identify elements
  • 14. Demo: Automatic Parent / Child List Relationship
  • 15. Demo: Showing / Hiding fields when a check box is checked
  • 16. Demo: Custom Field Validation
  • 17. Demo: Using REST for Cascading Drop Down Lists
  • 18. Demo: Improving Form Layout using HTML Templates