YUI复选框按钮

编程入门 行业动态 更新时间:2024-10-25 10:31:05
YUI复选框按钮 - 检索选中的值(YUI Checkbox Button - retrieving the checked value)

(我试过在YUI消息组上发布这个消息,但没有任何运气)

任何人都可以告诉我如何检索yui Button的选中状态吗? 我试过在代码中创建按钮,然后将其作为HTML按钮输出,但这只会改变title属性。

当我使用复选框时,没有选中复选框(当使用jQuery遍历它们时)。

有没有更简单的方法来做到这一点? 用3.0节点API或Element来说吧?

编辑:澄清这个问题是如何产生的,我使用YUI ASP.NET控件。 他们像这样将控件添加到页面中

Sys.Application.add_init(function() { $create(YUIAspNet.Button, {"ButtonID":"yuiMyButton_btn","ButtonName":"yuiMyButton$btn","TabIndex":0,"ButtonType":"checkbox","Text":"Technology"}, null, null, $get("yuiMyButton"));});

正如你所看到的,找到所有的按钮并不像我希望的那样简单。

(I've tried posting this on YUI message group but without any luck)

Can anyone tell me how to retrieve the checked state of a yui Button? I've tried by creating the Button in code, which is then outputted as a HTML button but this only changes the title attribute.

When I use checkboxes instead, none of the checkboxes are checked (when iterating through them with jQuery).

Is there an easier way of doing it? Say with the 3.0 Node API, or Element?

EDIT: To clarify how this problem came about, I'm using the YUI ASP.NET controls. They add controls to the page like this

Sys.Application.add_init(function() { $create(YUIAspNet.Button, {"ButtonID":"yuiMyButton_btn","ButtonName":"yuiMyButton$btn","TabIndex":0,"ButtonType":"checkbox","Text":"Technology"}, null, null, $get("yuiMyButton"));});

So as you can see, finding all buttons is not as simple as I'd like it to have been.

最满意答案

对不起,你在谈论复选框按钮 ? 使用:

myButton.get("checked")

myButton是YAHOO.widget.Button一个实例。

Sorry are you talking about checkbox buttons? Use:

myButton.get("checked")

where myButton is an instance of YAHOO.widget.Button.

更多推荐

Button,YUI,使用,按钮,title,电脑培训,计算机培训,IT培训"/> <meta name="descri

本文发布于:2023-08-05 10:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1431232.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:复选框   按钮   YUI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!