Set Default Value for Status Column on your NewForm.aspx using JQuery

Introduction

We are providing a quick tip on how you can set your Status column (dropdown) defaulted to Open/Close value using Jquery. When the Approver section select the Approved value then the automatic set status column Open Value and Approval select Reject value then automatic set status column Close Value.

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

 


Summary

In this Article we have explored and provided a quick tip on how you can set your column value using JQuery. 
Ebook Download
View all
Learn
View all