Set Default value for Status column on your NewForm.aspx using Jquery

set default value in drop down list sharepoint 2013 list form

In this post we will discuss how we can set status column (dropdownlist) default value to Open or Close using jQuery in SharePoint list form. We will see how we can set dropdown default value in SharePoint 2010 list form using jQuery. In this example we have a Approver, which has 2 radio button value. When user select Approve value then automatic status column will set to “Open” and if user select Reject, then automatic status column will set to “Close”.


If you want to learn SharePoint online then you can Download a FREE PDF on SharePoint online tutorial and Download FREE PDF on HUB site in SharePoint online. Also check another SharePoint tutorial SharePoint Online branding Creating Tabbed Menu using Bootstrap and HTML in SharePoint 2016/2013.

Code Steps:
<script language=”javascript” src=”/JS/jquery-1.9.0.min.js” type=”text/javascript”></script>

<script language=”javascript” type=”text/javascript”>
$(document).ready(function(){
var selected=””;
$(“.ms-RadioText input[type=’radio’]”).click(function(){
selected = $(“input[type=’radio’]:checked”);
if($(this).val() == “ctl00”)
{
$(“select[Title=’Tools Status’]”).val(‘Open’).attr(“selected”, “selected”);
}
else
{
$(“select[Title=’Tools Status’]”).val(‘Close’).attr(“selected”, “selected”);
}
});
});
</script>

Before Selecting Approver Option:

set default value in drop down list sharepoint 2010 list form

set default value in drop down list sharepoint 2010 list form

After Selecting Approver Option:

set default value in drop down list sharepoint 2013 list form



set default value in drop down list sharepoint 2013 list form

Check out Best Alternative to InfoPath -> Try Now

You May Also like the Following SharePoint Online Tutorials:

About Sagar Pardeshi

I am Developer working on Microsoft Technologies for the past 6+years. I am very much passionate about programming and my core skills are SharePoint, ASP.NET & C#,Jquery,Javascript,REST. I am running this blog to share my experience & learning with the community I am an MCP, MCTS .NET & Sharepoint 2010, MCPD Sharepoint 2010, and MCSD HTML 5,Sharepoint 2013 Core Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.

View all posts by Sagar Pardeshi →