简体   繁体   English

jQuery-Mobile:如何在外部Java脚本中使用名称属性启用选择标记

[英]Jquery-Mobile: how to enable select tag using name attribute in external java script

Initially my select tag is set to disable mode in html. 最初,我的选择标记在html中设置为禁用模式。 if you click on the select tag then i want to set to enable mode using onchange attribute. 如果您单击选择标记,那么我想使用onchange属性设置为启用模式。 In onchange attribute i am calling the external java script function.it is working in general html with javascript. 在onchange属性中,我正在调用外部Java脚本函数。它在使用javascript的通用html中工作。 But it is not working in jquery mobile. 但是它在jQuery mobile中不起作用。 please can anybody help me.Following is my code 请任何人可以帮助我。以下是我的代码

< select id ="Item_Activity" size="1" disabled="disabled" onchange="Enable_ST(this)">< /select> 

The code in external java script file is 外部Java脚本文件中的代码是

Enable_ST(item)

{

  item.disabled = false; 

}

thanks 谢谢

JQueryMobile generates span tags for its combo boxes, so disabling the "template" combo box is probably not going to do anything. JQueryMobile为其组合框生成span标签,因此禁用“模板”组合框可能不会做任何事情。

This is possibly similar to your issue, I realise its not JQM but rather Jquery UI, but the concepts should be similar: How to disable jquery ui combobox? 这可能与您的问题类似,我意识到它不是JQM,而是Jquery UI,但是概念应该相似: 如何禁用jquery ui组合框?

Effectively you are either going to have find the real HTML elements and disable them manually or you are going to have to call a JQM function to do it. 实际上,您要么找到真正的HTML元素并手动将其禁用,要么必须调用JQM函数来实现。 I recommend the latter. 我推荐后者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM