0

How to show default current year value in SharePoint list drop down when users clicking New form.

For Example.

Year Drop Down List contains 2017,2018,2019,2020

Expected Result: Year Drop Down selected current year value of 2019

Thanks

1
  • Is it a choice field? If so you’d just set its default to 2019
    – sasfrog
    May 11 '19 at 0:27
0

Change the default value to "Calculated Value" and put below formula:

=TEXT(Today,”YYYY”)

It will always selects current year dynamically.

0

We can add the code below into script editor web part in new form page to achieve it. Note: you need modify the column name in the code below to make it works.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
    var columnName="Year";
    var currentYear=(new Date()).getFullYear();
    $("select[title='"+columnName+"']").val(currentYear);
})
</script>

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.