SharePoint: Enable “Edit Page” on NewForm.aspx

Thanks to the solution here: I was able to get the “Edit Page” option to appear when adding a new list item.

I needed to do this because I wanted some Javascript to execute on that page to pre-populate some list item values. The script presented here worked great for one value.!B0C40902E1212960!473.entry

However, I have multiple querystring values, so I made a small change. (Entire code below, though.)


function fillDefaultValues() {
var qs =,;
var args = qs.split(“&”);
var vals = new Object();

for (var i=0; i < args.length; i++) {
var nameVal = args[i].split(“=”);
var temp = unescape(nameVal[1]).split(‘+’);

nameVal[1] = temp.join(‘ ‘);
vals[nameVal[0]] = nameVal[1];
//alert(‘fillDefaultValues: vals[nameVal[0]]=’ + vals[nameVal[0]] + ‘ nameVal[0]=’ + nameVal[0] );
setValueFromQueryString(nameVal[0], vals[nameVal[0]]);


function setValueFromQueryString(fieldName, value) {
//alert(‘setValueFromQueryString: fieldName=’ + fieldName + ‘ value=’ + value);
if (value == undefined) return;
var theField = getTagFromIdentifierAndTitle(“input”,”TextField”,fieldName);
if (theField != null) theField.value = value;

function getTagFromIdentifierAndTitle(tagName, identifier, title) {
//alert(‘getTagFromIdentifierAndTitle: tagName=’ + tagName + ‘ identifier=’ + identifier + ‘ title=’ + title);
var len = identifier.length;
var tags = document.getElementsByTagName(tagName);

for (var i=0; i < tags.length; i++) {
var tempString = tags[i].id;
if (tags[i].title == title && (identifier == “” || tempString.indexOf(identifier) == tempString.length – len)) {
//alert(‘getTagFromIdentifierAndTitle: tags[i].id=’ + tags[i].id + ‘ tags[i].title=’ + tags[i].title + ‘ tags[i]=’ + tags[i]);
return tags[i];
return null;

The final thing I needed to do was add a workflow to the list because I wanted to update another list when an entry was made in this one. This article was a great start:…

Instead of choosing an email action, I chose to update a list and added the actions to take as shown in the image below.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s