i have custom list form and i have OOTB attachment field but when i click submit button ,uploaded attachments not getting updated in list items
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script><script type="text/javascript">
$(document).ready(function()
{
$('nobr:contains("status")').closest('tr').hide();
});
function createListItem() {
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('Test');
var itemCreateInfo = new SP.ListItemCreationInformation();
this.oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', $("input[title='Title Required Field']").val());
oListItem.set_item('Attachments',$("input[title='Attachments']").val());
oListItem.set_item('status', 'submit');
oListItem.update();
clientContext.load(oListItem);
clientContext.executeQueryAsync(
Function.createDelegate(this, this.onQuerySucceeded),
Function.createDelegate(this, this.onQueryFailed)
);
}
function onQuerySucceeded() {
window.location.href="";
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() +
'\n' + args.get_stackTrace());
}
</script>
<input type="button" value="submit" onclick="createListItem()"/>
Blitz