Taking input from inside handlebar template file (.hbs)

走远了吗. 提交于 2019-12-13 07:19:41

问题


How to take user input from a handlebar template .hbs file and send it to some other js function as argument

I have tried so far:

{{ # each content }}
  <tr role="row">
.....
    <td
      <input name = "a" type="text" id="a_id" />
    </td>
    <td> 
      <button onclick="my_fn(a)"> SUBMIT </button>
    </td>
  </tr>
{{/each}}

For each data content there a row is created by this template .hbs file, in each row there is a field for taking user input and after entering text input a SUBMIT button is there in each row,clicking which a js function is called. the user input sent to the function "my_fn" as argument.

来源:https://stackoverflow.com/questions/37850038/taking-input-from-inside-handlebar-template-file-hbs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!