You want to pass a parameter value through URL to a new form and populate a field of the item (in this example a lookup field).
- Using SPD, create a New Form aspx page (you can also work directly on the NewForm.aspx page).
- Using the browser, connect to the aspx page and click Edit.
- Insert the Script Editor web part and add the relevant code (see below)
- Stop Editing the page (it will be automatically saved), and Cancel the form.
Now, you will be able to call the web page using URL parameter YourField:
newform.aspx?YourField=22
and open the form with the related lookup field populated with the item with ID 22.
I am able to get this to populate the field in my form when I'm in the form....but it isn't saving the value when I submit the form. Is there a way to get the value to actually save without clicking in the field and then hitting enter or tab? Has anyone else run into this issue?