Skip to content
Martin Price edited this page Apr 27, 2023 · 4 revisions

Text field

To prepopulate a text field in a webform called "name", the name attribute of that field would be submitted[name]. So the URL would be:

https://example.com/contact?edit[submitted][name]=John%20Doe

Radio button

To pre-select a radio option for a field with a name attribute of submitted[who_is_your_message_for], the URL could be:

https://example.com/contact?edit[submitted][who_is_your_message_for][2]=2

The [submitted] bit is from the name attribute of each of the radio buttons in the group: name="submitted[who_is_your_message_for]" but it has to go into square brackets. [2] and =2 refer to the value attribute of the individual radio button: value="2".

Dropdown

To pre-select a dropdown for a field with a name attribute of submitted[favorite_color], the URL could be:

https://example.com/contact?edit[submitted][favorite_color]=red

Where "red" is the key value for a label of "Red"

Source: here and here

Clone this wiki locally