在我的页面上,我有一个包含三个<select>下拉列表的表单。 所有这些列表都使用DropKick使它们看起来不错。
随着DropKick的添加,DDL不再是传统列表,因此无法访问。
根据我的发现,你只能通过在<form>标签上设置一个类然后使用以下脚本来调用onchange:
function submitIt(){ alert('test'); } $('.deviceChosen').dropkick({ change: submitIt });这有效,并提醒节目。 但是由于几个重要原因也行不通。
第一个<select>字段是唯一显示为结果的字段。 在该元素之后的网页上的所有其他内容都将从页面中删除。
所以我有三个DDL,我希望能够设置一个在deviceChosen id DDL被更改时调用的函数。 我不希望其他两个列表的onchange事件。
这是可行的吗?
我尝试过类似下面的内容,但它不起作用。
$('#deviceChosen').on('change', function() { alert('dsf'); });On my page, I have a form with three <select> drop down lists. All these lists use DropKick to make them look nice.
With DropKick added, the DDLs are no longer conventional lists and so cannot be accessed as such.
From what I've found, you can only call onchange by setting a class on the <form> tag and then using the following script:
function submitIt(){ alert('test'); } $('.deviceChosen').dropkick({ change: submitIt });This works, and alert shows. But also doesn't work for a couple of big reasons.
The first <select> field is the only field that gets shown as a result. And everything else on the web page after that element gets removed from the page.
So what I have is three DDLs and I want to be able to set up a function that gets called when the deviceChosen id DDL gets changed. I don't want an onchange event for the other two lists.
Is this something that is doable?
I've tried things like the below, but it just will not work.
$('#deviceChosen').on('change', function() { alert('dsf'); });最满意答案
我无法让这个工作,所以我最终使用了selectBox
http://labs.abeautifulsite.net/jquery-selectBox/
I couldn't get this working, so I ended up using selectBox instead
http://labs.abeautifulsite.net/jquery-selectBox/
更多推荐
发布评论