Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Populate field value in out of box form from URL parameter using javascript

$
0
0

I have tried to populate a field (IncID) in an “out of box” SharePoint form from URL parameter. I added content editor on the page with the following script. I get the correct value in variable iid. However, I am not able to set the field value. It seem the document is not “ready” when the script is running? I just wonder is there a way to accomplish my need. Many thanks.

<script language="javascript">
    //*** GET QUERYSTRING VALUE
    qs = window.location.search.substring(1);
    vs = qs.indexOf("=") + 1;
    iid = qs.slice(vs * -1);
    //*** SET FIELD VALUE
    $("input[title='IncID']").val(iid);  
</script>


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>