Active
Project:
Prepopulate
Version:
7.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Sep 2009 at 13:30 UTC
Updated:
17 May 2019 at 04:50 UTC
Jump to comment: Most recent
For prepopulating lists i did not unserstand correctly:
An example for prepopulating lits would be:
<div class="webform-component-select" id="webform-component-liste">
<div class="form-item" id="edit-submitted-liste-wrapper">
<label for="edit-submitted-liste">LISTE: <span class="form-required" title="This field is required.">*</span></label>
<select name="submitted[liste]" class="form-select required" id="edit-submitted-liste" >
<option value="">select...</option>
<option value="1" selected="selected"> dername</option>
<option value="2"> noch ein name</option>
</select>
To prepopulate a list you need to look for the content of the name attribute. In this example it says name="submitted[liste]"
Url example: http://localhost/drupal_testumgebung/node/51?edit[submitted][liste]=1
As you see you need to use [submitted][liste], NOT submitted[liste]. After the "=" you need to put the content of "value" of the option object, to select it.
I think this might be useful. Thank you
Comments
Comment #1
1800collect commentedI second adding this as you pointing this out saved me a lot of time! Thank you!
Comment #2
stephenhlane commentedThanks. this helped me get the URL layout I was looking for.
Comment #3
Katy Jockelson commentedThanks @marcoka - this made it really clear.