我想在id = "utr_c"
位置使用*
的输入值。在最后一行的第6行。
如何在车把模板文件中使用:
{{#each content}}
{{#if isOddLine}}
<tr id = {{utr_id}} role="row" class="oddLine">
{{else}}
<tr id = {{utr_id}} role="row" class="evenLine">
{{/if}}
<td class="data-display-field" style="text-align: left;"><strong>{{creation_date}}</strong></td>
<td class="data-display-field" style="text-align: right;"><strong>{{shipper_name}}</strong></td>
<td class="data-display-field" style="text-align: right;"><strong>{{amount.amount_with_penny}}</strong></td>
<td class="data-display-field" style="text-align: right;">
<input type = "text" id="utr_c">
</td>
<td class="data-display-field" style="text-align: right;">
<form action="/disbursements/get_utr_code" method="post">
<input type="hidden" name="utr_id" value="{{utr_id}}">
<input type="hidden" name="shipper_name" value ="{{shipper_name}}">
<input type="hidden" name="biller_id" value ="{{biller_id}}">
<input type="hidden" name="utrc" value = * >
<input type="submit" value="Submit UTR" class="btn-style" style="float:right; line-height: 12px; padding: 5px 12px; margin-right: 6px; margin-top: 5px;">
</form>
</td>
</tr>
{{/each}}
答案 0 :(得分:0)
尝试.js文件:
.hbs
<input type="hidden" name="utrc" value = {{{test_name}}} >
.es6
Template({
...
test_name: `"${this.model.test_name}"`
});
Handlebars HTML-escapes {{expression}}返回的值。如果您不希望Handlebars转义值,请使用“triple-stash”,{{{。
根据Handlebars文档http://handlebarsjs.com/expressions.html