Friday 10 January 2014

Handling event of SharePoint form dropdown value change

Problem Description:

Many times we want to perform event handling on SharePoint list’s form.
This blog will give us idea about “Choice” column value change event handling.

As usual add Content Editor WebPart into SP list form and copy paste below code into HTML form.


<script type="text/javascript">

_spBodyOnLoadFunctionNames.push("ourFunctionName");

function ourFunctionName()
{

$("Select[Title='ColumnName']").change(function () {
alert("Choice column value changed");
});
}

</script>

Reference:



Remark:

For Date and Time column is quite different, for that follow below link,


Nice article written by Ruud Stijger.


3 comments:

  1. Excellent. I spent 3 days to get it. Browsed all the sites from Google results and applied to my forms. Finally this code working well with forms. Thank you Ruud Stijger

    ReplyDelete