I am trying to learn handlebars for use in my MVC app. I have the following in my template:
<div class="control-group">
<label class="control-label" for="EmailHtml">Html:</label>
<div class="controls">
<textarea id="EmailHtml" name="EmailHtml" cols="36" rows="5"/>
</div>
</div>
And here is the JSON:
{"data":{"Results":[{"EmailHtml":"xyz"}],"Name":"Test Business"}}
After executing the above I see a TextArea with the correct width and height, but I don't see any data in it.
I also tried inserting the value="{{this.EmailHtml}}" but it still doesn't work.
How I get the textarea to be populated in my template?
Shouldn't that be something more like:
<div class="control-group">
<label class="control-label" for="EmailHtml">Html:</label>
<div class="controls">
<textarea id="EmailHtml" name="EmailHtml" cols="36" rows="5">{{EmailHTML}}</textarea>
</div>
</div>
The value of a <textarea> is not in a value attribute, but resides between the tags. See: http://www.w3.org/TR/html401/interact/forms.html#h-17.7 , http://www.w3.org/TR/html-markup/textarea.html , among others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With