Closed (fixed)
Project:
Prepopulate
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2010 at 18:57 UTC
Updated:
3 May 2013 at 15:07 UTC
For the life of me I can't figure out how to get an item in a select list pre-populated. The HTML output of the form is
And I thought I could select it using:
node/add/factsheet?edit[field_office][value][]=Speaker
Any help is appreciated.
Phillip
Comments
Comment #1
edonnelly commentedPart of your post disappeared (the html output).
There's currently an open issue related to CCK and prepopluate 6.x-2.0: #883980: New field formats are necessary in Prepopulate 6.x-2.x
The syntax that previously worked for me on my select list would be:
node/add/factsheet?edit[field_office][0][value]=Speaker
so you might give that a try after applying the patch discussed in the above issue, but I'm not sure if there has been a change in the necessary syntax. Good luck.
Comment #2
pcave commentedThanks! The open issue definitely had a hand in it. However, I do have another question about a multiple select field. It's not a CCK field, but rather a list of organic groups. And again, I can't figure out how to pre-select any of them.
<select name="og_groups[]" multiple="multiple" class="form-select og-audience" id="edit-og-groups"><optgroup label="My groups"><option value="393481">Chiefs of Staff</option></optgroup><optgroup label="Other groups"><option value="411592">2010 Census</option>I'm trying /node/add/factsheet?edit[og_groups][]=411592 to select the 2010 Census option.
Thanks again for your help.
Comment #3
wylbur commentedTry the latest version of prepopulate, and use this url:
/node/add/factsheet?edit[og_groups][][value]=411592
Comment #4
fehin commentedI need help,I can't get select to work. If I change it to checkbox, this works:
&edit[field_request_node_type][und][Request]=Requestbut it doesn't work for select list.Comment #5
fehin commentedThis worked:
&edit[field_request_node_type][und]=Request