Radio Buttons and IE8

cheema

New Member
Hi Wondering is any one can help!

I've been having problems with using radio buttons in a button group specifically using IE 8 - I know that its redundant and old etc, but its what we have to use.

This is my first proper fabrik form ..

So I have a radio button 2 values yes/ no
on yes -> Show a textbox
on no -> Hide the textbox

Should be simple set it up with the JS Predefined actions > onclick ..
Works apart from with IE 8
Have Tried on change/onblur no trigger.

The only thing that does (sortof) work is the onload ..

adding the following JS
Code:
var element = Fabrik.getBlock('form_X').formElements.get('XXX_XXX___element ');

var elementparent = $(this).getParent();
elementparent.addEvent("click",function(){

if (element.get('value')=="no"){
  element2.hide();
}else{
element2.show();
}

}

which sort of works ish ...
there are 2 issues that have come up with this the first is that the element.get('value'); doesn't pick up the state properly . i.e. if No and you click Yes it returns "NO" then if you click back to no it returns "YES"

the other is that the .show() brings back the Object expected Error line 132 mootools-ext.js which relates to
Code:
show:function(v){....}

I'm probably doing it wrong .. i did try the addElementFX() and doElementFX() methods too, but no luck

any pointers / tips would be great
 
I think i've managed to get it working by switching to jQuery... The below seems to work ...

Code:
jQuery('#element >.radio>.btn').on('click',function(){
setupform();
});

setupform();

function setupform(){
  if(jQuery(this).find('.btn-success').hasClass('fabrikgrid_yes')){
    jQuery('#element2').parents('.control-group').show();
  }else{
    jQuery('#element2').parents('.control-group').hide();
  }
}
 
Thanks for posting your solution.

Yes, radio button click handling in IE8 is a monumental pain in the ...

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top