YUI Radiobutton ASP.Net oncheckedchanged

502 views Asked by At

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?

1

There are 1 answers

2
gmedina On BEST ANSWER

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