how to change value in drop down based on button click using JQuery in SharePoint

how to change value in drop down based on button click using JQuery in SharePoint
In this article we can able to show how to change value in drop down based on button click
In the SharePoint List Edit page having button and column with name “Status” by default it was showing Status as Open, when we click on the button it will change the value to completed.


<script>
function ChangeStatus(){
$('Select[title=Status]').val('Completed');
}
</script>
<table>
<tr>
<td ><input type="button" id="btn" value="Change the Status" onclick="ChangeStatus();"/></td>
</tr>

</table>

SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM

How to get the date in textbox using JQuery

In this article we can able to see how to get the date with hours and minutes using JQuery.
We have to display the date, hours and minutes without any special characters.
Refer the JS file and use the below script.
Example:DDMMYYHHMM
  
<script>
var sp=new Date();
var day=sp.getDate();
var month=sp.getMonth()+1;
var year=sp.getFullYear();
var hour=sp.getHours();
var minute=sp.getMinutes();
var ddmmyy=day+""+month+""+year+""+hour+""+minute;
$("input[title^='DateField']").val(ddmmyy);
});
</script>

OutPut:




SharePoint Online Real Time Training Contact: JLAKSHMITULASI@GMAIL.COM