Closed (outdated)
Project:
Prepopulate
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2008 at 05:15 UTC
Updated:
14 Oct 2016 at 04:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
add1sun commentedpretty sure you need to use edit[field_name]=1
Comment #2
add1sun commentedno response. closing
Comment #3
mikeytown2 commentedin 6.x-2.x-dev
with content that looks like this
set the equal to the number after the value bracket. example
...?edit[field_mine_taxonomy][value][47]=47
Comment #5
OptimusPrime23 commented$form['item'][item2]['check'] = array(
'#suffix' => "'#type' => 'checkbox',
'#default_value' => 1,
'#prefix' => "
",
);
the default_value makes in checked hope this resolves ur issue
Comment #6
deviantintegral commentedIf you want to make it work for checkboxes, and not just a single checkbox, you set the value to be the value of the checkbox. Example:
user/register?edit[field_customer_segment][value][Home%20Owner]=Home%20Owner
Comment #7
giorgio79 commentedNot sure this does not seem to be working for me
Comment #8
wgrunberg commentedI am also having difficulties checking a CCK "Single on/off checkbox" field (double post from #799348: Prepolutaing CCK "Single on/off checkbox" field?).
Given the following form element and some Devel exploration:
<input type="checkbox" class="form-checkbox" value="on" id="edit-field-core-template-value" name="field_core_template[value]">I have unsuccessfully tried:
edit[field_core_template]=on
edit[field_core_template]=1
edit[field_core_template][value]=on
edit[field_core_template][value]=1
edit[field_core_template][0][value]=on
edit[field_core_template][0][value]=1
etc.
I ended up converting the check-box into a select list. No problems there. This is a great module.
Comment #9
electblake commentedI found a solution!
So, I was attempting to select a checkbox.
usually I would follow the name of the input to populate the field. (that is the html parameter name="")
But in my case (of organic groups) it was more complicated.
note, this is ?edit[field_name]=value of checked box.
The prepopulate module does not check if the $form['#default_value'] accepts an array or a plain string, so as checkboxes field types are looking for an array, our values would be ignored.
I'm sure there is a more elegant solution, and this obviously only solves the problem for checkboxes not any other array casted default_value field types.
But its something that we can finally build on :)
Comment #10
dawehnerIt's already possible when you use such a syntax
Comment #11
TimelessDomain commentedHow can this be done in Drupal 7? For ex. a taxonomy reference field
does this need to be added? where?
Documentation for checkboxes should be added to USAGE.txt
Comment #12
malcomio commentedHere is a patch of usage.txt which says how to target node reference checkboxes
Comment #13
jbrauer commentedClosing D6 issues as it's no longer supported.