문제

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