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

edonnelly’s picture

Part 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.

pcave’s picture

Thanks! 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.

wylbur’s picture

Try the latest version of prepopulate, and use this url:
/node/add/factsheet?edit[og_groups][][value]=411592

fehin’s picture

I need help,I can't get select to work. If I change it to checkbox, this works: &edit[field_request_node_type][und][Request]=Request but it doesn't work for select list.

fehin’s picture

Version: 6.x-2.0 » 7.x-2.x-dev
Status: Active » Closed (fixed)

This worked: &edit[field_request_node_type][und]=Request