Skip to main content

I have a javascript below in a standard SP 2013 OOTB Document Library NewForm.aspx that pulls ID from the source section of a URL and works great as i:


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js "></script>


<script type="text/javascript">


setTimeout(function(){


    var theValue = GetUrlKeyValue("ID",false,unescape(GetUrlKeyValue("Source")));


    document.getElementById("Project_x0020_ID_83d3d8e5-1352-4fba-bd8b-86bddaf97847_$NumberField").value = theValue;


},1000);


</script>


 


I am looking to get this same/similar script working in a Nintex Form.  So to be clear, the ID that I am looking for is in the &Source= section of the URL and is encoded so I can't use the GetQueryString function.  I tried this script below and on the Single Line Textbox Control settings set "Stored Client ID in JavaScript variable to "Yes" and set the Client ID JavaScript variable name to PIDValue but this did not work:
















$(document).ready(function() {
var PIDValue=GetUrlKeyValue("ID",false,unescape(GetUrlKeyValue("Source")));
NWF$(‘#’+ProjectID).val(PIDValue);
});










I could not get the formula to work to grab from the &Source part of the URL so I went with the path of least resistance and instead added the variable I needed to the URL using instructions as provided here: https://community.nintex.com/t5/Nintex-for-SharePoint/Add-variable-to-URL-on-Nintex-Form/td-p/64186


and then in turn I was able to use the GetQueryString function


 


 


Reply