This module allows to pass form element default values into URLs and substitute them into form elements. This is very useful when you have a content type with fields and you want to build a link which must open a node adding form with several fields already initialized with default values.

We support the following form elements:

  • Standard FAPI
    1. text
    2. textarea
    3. checkbox
    4. select ( + multiple)
  • CCK Fields:
    1. text ( + multiple)
    2. number ( + multiple)
    3. date ( + multiple)
    4. user reference ( + multiple)
    5. node reference ( + multiple)
    6. NEW email ( + multiple)
    7. NEW taxonomy ( + multiple)
  • Webform elements
    1. date
    2. email
    3. hidden
    4. markup
    5. select (+ multiple)
    6. textarea
    7. textfield


To pass a field default value use this field1=value1 or field1=value1||value2 for a field in a multiple mode. Use ^0 marker to hide this field from the form (you may want to initialize a field and disable an ability to change it). Also you can use ^1 marker to convert this field into markup (title and value are visible) or ^2 marker to convert this field into disabled (eq disabled="disabled" in HTML code) form element*.
NOTE: webform date and all cck fields does not support ^2 marker!

Use cases:

Case 1

You have two content types Group and Item. Item has a Node Reference to the Group. You want to put a link on the Group page 'Add an item to this group'. This link will open a node add form for the new Item and you want a Group node reference field to be initialized with the NID of the Group you are comming from. Use syntax like this: to set the default value which can be changed by the user or^0 to initialize the field and hide it from the form so that user can't change it. So you can guarantee that the saved Item will refer the needed Group.

Case 2

You have a 'Request More Information About a Product' webform with a Product ID text field. You have a list of products each of which has a link pointing to this webform. You want to pass product ID so it is populated into webform Product ID field and is sent to the contact person. Use this syntax:^0 or^2 if you want to show field to your visitors, but don't want it to be changed by user. Also you can try ^1 marker to convert field to markup.

Case 3

You have an Item content type with multiple Names (textfield) and multiple Recepients (email/text). You want to provide a link which will populated 3 names and emails to the Item node add form. Use this syntax:||Tommy||Jessica&||

New in version 6.x-1.4

Added programmable access to field default values through elementdefaults_alter hook. That means if you want to set up default values of specific field you can do this by adding yourmodule_elementdefaults_alter implementation in your module or theme with this code:

function mymodule_elementdefaults_alter($request) {
  return $request;

NOTE: $form[#elementdefaults]['element_name']='value' is no more support in version 6.x-1.4

We have a co-maintainer of this module - ershov.andrey.

Project Information