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>