I want to prepopulate a node reference field for content_type AAAA, while creating BBBB.
I see following in View Source of add form of BBBB
<div class="form-item">
<label for="edit-field-aaaa-nids">AAAA: <span class="form-required" title="This field is required.">*</span></label>
<select name="field_aaaa[nids]" class="form-select required" id="edit-field-aaaa-nids" ><option value="11">aaaa1111</option><option value="22">aaaa2222</option></select>
</div>
I used the following link to prepopulate.. But it didn't work
http://www.mysite.com/?q=node/add/BBBB&edit[field_aaaa][nids]=22
Am i doing something wrong
Comments
Comment #1
websites-development.com commentedadd the group fieldset, if any
edit[group_name][field_aaaa][nids]=222
Comment #2
gagarine commentedDon't work on D6 see http://drupal.org/node/258449
Comment #3
Gerald Mengisen commentedAs an alternative, you can use the Custom Links module, set up a link with the nid as parameter, and add the following code to your CCK node reference field's PHP default value:
Comment #4
joachim commentedThat's a really handy bit of code! It should really go into a handbook page for CCK somewhere!
Comment #5
ferrangil commentedSubscribing...
Comment #6
falco8 commentedsubscribing
Comment #7
jbrauer commentedClosing issues for unsupported 5.x version