为什么不是'我的onchange函数不起作用
Why isn't my onchange function working?
我是ruby的新手,尝试在这里调用js函数onchange,但没有工作,也没有得到合适的答案。
= f.select :amendment_type, [['Renewal','renewal'],['Lease Amendment Agreement','Lease Amendment Agreement'],['Expansion','Expansion'],['Storage','Storage'],['Parking','Parking'],['Other(for me to fill in)','Other']], class: "amendment_type input", style: "width: 450px;", onchange: "alert('hello')"
select
方法参数为:
select(method,choices=nil,options={},html_options={}和block)
您已经使用了options
来对抗html_options
,因此您必须将代码替换为:
= f.select :amendment_type, [['Renewal','renewal'],['Lease Amendment Agreement','Lease Amendment Agreement'],['Expansion','Expansion'],['Storage','Storage'],['Parking','Parking'],['Other(for me to fill in)','Other']], {}, class: "amendment_type input", style: "width: 450px;", onchange: "alert('hello')"
相关文章:
- 试图将onChange函数作为道具传递给GrandChlidren,结果是TypeError:这是未定义的
- onChange 函数更改表中显示的数据
- 从javascript调用服务器端的下拉列表onchange函数
- 从Document调用onchange函数.已准备好从更新中预先选择的项目
- 根据其他onchange函数来选择在onchange中运行哪个函数
- 对于新建的元素,onchange函数只调用一次
- jquery中的下拉onchange函数
- Internet Explorer没有't执行onChange函数
- 使用js使html按钮更新选择标记onchange函数
- java脚本中用于多个控件的单个onchange函数
- 如何将 ng-repeat 变量的值传递到 input[“file”] 的 onchange 函数中
- onchange 函数需要时间来刷新页面
- 如何指定在另一个函数中定义的 onchange 函数
- 如何在 Rails 中将值从 collection_select 传递给 onchange 函数
- $.click() 和 $.trigger() 不会激活复选框的 onchange 函数
- Javascript:执行 onchange 函数时选择的值是什么
- 如何在动态生成的选择标签中实现onchange函数
- 为什么不是'我的onchange函数不起作用
- 需要选择一个新列,并使用带有下拉菜单的onchange函数打印到文本区域
- Onchange函数使用laravel5不起作用