Dreamweaver

Apply the Set Text Of Text Field behavior

The Set Text Of Text Field behavior replaces the content of a form’s text field with the content you specify.

You can embed any valid JavaScript function call, property, global variable, or other expression in the text. To embed a JavaScript expression, place it inside braces ({}). To display a brace, precede it with a backslash (\{).

Example:

The URL for this page is {window.location}, and today is {new Date()}.

Create a named text field

  1. Select Insert > Form > Text Field.

    If Dreamweaver prompts you to add a form tag, click Yes.

  2. In the Property inspector, type a name for the text field. Make sure the name is unique on the page (don’t use the same name for multiple elements on the same page, even if they’re in different forms).

Apply Set Text Of Text Field

  1. Select a text field and choose Set Text > Set Text Of Field from the Actions menu of the Behaviors panel.
  2. Select the target text field from the Text Field menu and enter your new text.
  3. Click OK and verify that the default event is correct. If not, select another event or change the target browser in the Show Events For submenu.