Home > SharePoint > Copy value from column to another using JQuery

Copy value from column to another using JQuery


Copy the value from one column to another column on a New List Item Form.

In this example, I am populating the End Date Field with the Start Date Field value when user is filling out a meeting request form in SharePoint.

Add the following code on the page under “PlaceHolderMain” tag.

<script type="text/javascript" src="../../Shared Documents/Javascript/jquery/jquery.js">

$(document).ready(function(){
var strStartDate = $("input[title='Start Date']");
strStartDate.focusout(function()
 {
$("input[title='End Date']").val(strStartDate.val());
});
});
</script>

Advertisements
  1. April 22, 2014 at 9:06 pm

    This post may be a few years old, but it just saved my bacon. I’ve been looking all over for how to do this using JQuery or even plain ol’ JavaScript with no luck.

    Thanks a ton for both writing it AND leaving it up this long!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: