Set a Default Value in an Input Text Box

I’m trying to set a default value to an Input Text Box, but when I send the template down the Connect Designer crashes. I would like to use a @MYFIELD@ as the default value.

Is this possible?

In the oncoming release (version 1.3) you could simply drag the data field from the Data Model and drop it on the input field. This would insert a script that sets the default value of the input.

In v1.2 you need to create the script yourself. To create a script that sets the default value of an input field:

  1. Assign an ID to the input field e.g. firstname
    (select the input and enter the ID via the Attributes panel or enter it via the Source view)
  2. Create a new Script via the Scripts panel
  3. Set the selection method of the script to Selector
  4. Enter the ID of the input in the Selector field e.g #firstname
  5. Enter the following script to set the value of the data field to the value attribute of the input:
results.attr('value',record.fields.FirstName);

I hope this is of some help,

Erik

This worked great!

I’m using the field as a sticky value so they don’t need to enter it in each time, but I need an easy method to clear the value. I tried to use a reset button, but the value remains, I tried to reload the page location.reload(); , but it resubmits the values. and retains the value anyway. I tried using the ‘placeholder’ functionality instead of ‘value’, but it does not let me hit enter to keep the value.

Any ideas?