Attempting to pre-select an attribute for a particular product and can't seem to make it work, (even on a simple textfield attribute -- ultimately need to select a value from a listbox but keeping it simple till i get it working). Can anyone experienced shed some light on this?
http://www.example.com/my-product?edit[attributes][2][1][value]=test
is not working when the definition of the textarea looks like this:
<input type="text" maxlength="128" name="attributes[2]" id="edit-attributes-2-1" size="60" value="" class="form-text" />
Either I have this wrong, or it just isn't going to work. Thoughts? Thanks!!!!
Cheers,
j
Comments
Comment #1
jruberto commentedokay, a few deep breaths and some careful reading of the documentation got me there. for the example above the magic URL was:
http://www.example.com/my-product?edit[attributes][2]=test
Comment #2
Toon Huysmans commentedHmm, this does not seem to work in my case.
I can prepopulate the quantity field with '5' using: http://www.example.com?q=node/18&edit[qty]=5
where the definition of the element looks like:
<input type="text" class="form-text" value="5" size="5" id="edit-qty" name="qty" maxlength="6">A similar approach to populate the first attribute, unfortunately, does not work in my case: http://www.example.com?q=node/18&edit[attributes][1]=text
where the definition of the element looks like:
<input type="text" class="form-text" value="" size="60" id="edit-attributes-1" name="attributes[1]" maxlength="128">How can I figure out which keys I have to use to address this attribute in the url? Thanks!
Comment #3
Toon Huysmans commentedAh, update to 6.x-2.x-dev solves the issue. Great!
Comment #4
Stomper commentedI have created a user location field in a custom content_profile CCK form. I also have a location field in the custom product class form for UberCart. I would like to prepopulate the location field (product form) with the information from the location field in the content_profile form.
Would it also be possible to have a checkbox or radio button that would allow the user to "Click to use current location information (prepopulate)" or "Other" which would allow users to enter different location information?
Being able to display the location information on the product page as well as use them in views would be beneficial too.
Comment #5
wylbur commentedPrepopulate fills in forms from the URL. Is that what you are trying to do? You could create two links, one with the prepopulate fields, and one without.
Comment #6
Stomper commentedI'm not prepopulating from a URL technically, just using content from one field to populate another from different content types.
Comment #7
scuba_fly