【问题标题】:Is there a way to use a custom button to add a value for Aldeed: Autoform有没有办法使用自定义按钮为 Aldeed 添加值:Autoform
【发布时间】:2016-08-16 03:26:55
【问题描述】:

我有一个流星应用程序,我正在使用 Aldeed: Autoform 将生成的表单直接插入基于模式的数据库中。有没有一种方法可以使用我自己的自定义按钮或输入字段,而不是使用 autoform 提供的选项?我希望这样做,因为我需要在单击其中一个按钮时执行 onclick 功能,但自动生成按钮不是普通按钮,我无法添加 onclick 属性。

当我说提供的选项时,我的意思是:

{{> afQuickField name='game'}}

我想以某种方式替换它:

<button id="makeLobBtn" class="button" type="button" onclick="div_show()">Make Lobby</button>

【问题讨论】:

    标签: javascript meteor meteor-autoform


    【解决方案1】:

    当然 - 您可以使用 {{#autoForm}} 组件来执行此操作:

    {{#autoForm id="demo" schema=schema}}
      {{> afQuickFields}}
      <div>
        <button type="submit">Submit</button>
      </div>
    {{/autoForm}}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-04-15
      • 1970-01-01
      • 2020-09-06
      • 2011-06-24
      • 2012-11-03
      • 1970-01-01
      • 2020-11-13
      相关资源
      最近更新 更多