Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top