I'm a wanna be programmer with my first question here :)
I'm using SP 2010 Foundation without any option to program on server side or with SharePoint Designer. I need to add a button on a "View form" of a list
(https://SITE/LIST/DispForm.aspx?ID=384
)
The button's code is:
<input class="afxAddItemButton" onclick="window.location.href='https://SITE/PAGE_ADDRESS.aspx?dbSpListId=ITEM ID HERE'" type="button" value="Button name"/>
I also have a JS script registered on this page. This code is used on another page to read dbSpListId value from URL, so I guess it could be modified to read ID value from "View item" page:
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
Unfortunately I don't know how to place the value extracted by JS into the button code. Is it even possible?
Best regards!