質問

I'm using YUI framework to style my radiobuttons and want to use the oncheckedchanged event to redirect to another page. It works just fine with traditional radiobuttons but using with the YUI framework the oncheckedchanged event never fires. Almost as if YUI has a built in function replacing it. Are there any workarounds to this?

役に立ちましたか?

解決

so YUI replaces <input type='radio'... for some html that looks something like this <span><span><button /></span></span>

So whatever function you are attaching for the oncheckedchanged event, you probably would have to attach it as a click or change event using YUI's api, so it'd look something like this.

var buttonGroup = new YAHOO.widget.ButtonGroup("radiogroup"); //init buttons
var buttons = buttonGroup.getButtons(); //get the buttons
buttons[0].on('click', function(){alert('a');}); //attach event, you probably need to iterate the buttons array to attach events to all the buttons
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top