This project has moved and is read-only. For the latest updates, please go here.

Unable to get a SPField named Engineer

Apr 16, 2015 at 11:54 AM

First off - thanks for going to the effort to make this, it's much appreciated.

I've followed the instructions on installing this to our SharePoint 2013 site, however it seems that I can't find the fields to action anything on?

I've got a NewForm.aspx (created using the Survey app) that i've edited, and added in a CEWP below the form, and embedded code into it as such - as listed in the documentation:
<script src="/EngineeringOperations/TS/SiteAssets/jquery-1.11.2.min.js"></script>
<script src="/EngineeringOperations/TS/SiteAssets/sputility.min.js"></script>
<script type="text/javascript">
var urlParams;
(window.onpopstate = function () {
    var match,
        pl     = /\+/g,  // Regex for replacing addition symbol with a space
        search = /([^&=]+)=?([^&]*)/g,
        decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
        query  =;

    urlParams = {};
    while (match = search.exec(query))
       urlParams[decode(match[1])] = decode(match[2]);

// wait for the window to load
$(window).load(function () {
  try {
    var urlValue = urlParams['Engineer'];
  } catch (ex) {
However it seems to constantly state there's no SPField with the name of Engineer?

I've checked the source of the page, there's definitely an Engineer field there:
          <td valign="top" width="90%" class="ms-formbody">
          <!-- FieldName="Engineer"
            <span dir="none">
        <input name="ctl00$ctl35$g_be337ba3_17d9_446d_a012_9a5322408745$ctl00$ctl02$ctl01$ctl00$ctl00$ctl04$ctl00$ctl00$TextField" type="text" maxlength="255" id="ctl00_ctl35_g_be337ba3_17d9_446d_a012_9a5322408745_ctl00_ctl02_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_TextField" title="Engineer" class="ms-long ms-spellcheck-true" /><br />
Am I doing something wrong here?

The script is clearly installed right else i'd not be getting an alert I guess..


Apr 20, 2015 at 3:06 PM
Yea, based on the error it does seem like jQuery and SPUtility.js are set up correctly. I will see if I can set this up in my environment to reproduce the error you're getting.
Apr 21, 2015 at 4:45 PM
I had a similar issue... changing lazyLoadSPFields() to populate surveyElements based on '' (rather than formbody_survey_) seems to fix it for me.