I am looking to bulk-edit a column in JavaScript with the same numerical value and have the following code that will work if I use a hard-coded number, but I want to use a variable from a user input instead:
function changeValues()
{
var context = SP.ClientContext.get_current();
var selectedItems = SP.ListOperation.Selection.getSelectedItems(context);
var list = context.get_web().get_lists().getByTitle("ListTitle");
var item;
for (item in selectedItems)
{
var newValue = document.getElementsByName("htmlInput")[0]; //This is the value I want to use
var myResItem = list.getItemById(selectedItems[item].id);
myResItem.set_item("ColumnName",newValue); //This is where hard-coded numbers work
myResItem.update();
}
I think I need to somehow format the "newValue" variable (SPFieldNumber?) but I have had no luck with my attempts thus far.