Question

enter image description hereI have the input type as text for the date field and I am confused how to store the same in a variable and on change of that date function need to populate other column values SharePoint list. I need to populate values based on two field changes in SharePoint list. i.e on selection of both field certain fields should populate. Can anyone help me with this?

Was it helpful?

Solution

The input value can be got with Jquery:

var test=$("input[title='Date']").val();

And you could trace the value change for this date field control in the new form like this:

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(document).ready(function() {
  $('input[title="Date"]').get(0).onvaluesetfrompicker=DatePickerChanged;    
});

function DatePickerChanged() {
    // Do stuff

    alert("value changed");
}
</script>

Write your populate logic code in DatePickerChanged function.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top