throw new Error('Field type {type} not recognized.'.replace('{type}', field.type));
}
body.append(
- _.template(template)(_.extend({description: ''}, field))
+ _.template(template)(_.extend({description: '', initialValue: ''}, field))
);
});
<%= label %>:
</div>
<div>
- <input type="input" name="<%= name %>"/>
+ <input type="input" name="<%= name %>" value="<%= initialValue %>"/>
<span class="description"><%= description %></span>
</div>
<p>
<label><%= label %></label>
- <textarea name="<%= name %>" rows="5"></textarea>
+ <textarea name="<%= name %>" rows="5"><%= initialValue %></textarea>
<span class="description"><%= description %></span>
</p>