Closed (fixed)
Project:
Prepopulate
Version:
6.x-2.1
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2007 at 17:25 UTC
Updated:
29 Sep 2011 at 15:36 UTC
Is prepopulate meant to work with CCK select boxes. I have HTML like:
BPMBREselect>I tried to prepop with:
http://drupal.mysite.com/?q=node/add/project&edit[field_project_type][ke...
but it doesn't work. Is there another syntax I need to try?
Comments
Comment #1
ChrisBryant commentedI'm trying to do the same thing here with CCK content types and no luck. Is it not supported at this time?
Chris
Comment #2
ChrisBryant commentedAfter reading through this page/comment (http://drupal.org/node/81945#comment-137233) I was able to figure how to get it to work with CCK field types.
Here is an example with snippets of the page source:
Issue Type:
Priority:
Status:
Project:
So if I do any of the following it works:
domain.com/node/add/issue&edit[field_issue_type][key]=Task
domain.com/node/add/issue&edit[field_priority][key]=1
domain.com/node/add/issue&edit[field_issue_status][key]=Active
domain.com/node/add/issue&edit[field_project][nids]=749
Priority Key 1 will set it to "Urgent" and Project NIDS 749 will set it to "Cool Project 2," beautiful and thanks!!!
Now... how to make it so we can set multiple fields in the same URL? First I was using "?" in the url but now I changed them to "&" and it all works! This sets everything:
domain.com/node/add/issue&edit[field_issue_type][key]=Task&edit[field_priority][key]=1&edit[field_issue_status][key]=Active&edit[field_project][nids]=749
Many thanks, this is great!
Chris
Comment #3
add1sun commentedMoving this to a docs task so it is clear for others in the future.
Comment #4
jbrauer commentedComment #5
mudatrust commented