I have the following code.
function radioButtons() {
var _inputCount;
var _inputParentCount;
var _radioInput;
return {
inputCounter:function(groupId){
_inputCount = $(groupId).find("input");
_inputParentCount = $(_inputCount).parent();
for(i = 0; i < _inputParentCount.length; i++){
$(_inputParentCount[i]).attr("id", groupId + [i]);
}
},
radioAction:function(radioButton){
_radioInput = $(radioButton).find("input");
for(i = 0; i < _inputCount.length; i ++){
$(_inputCount[i]).parent().removeClass("selected");
$(_inputCount[i]).attr("value", "false");
}
$(radioButton).addClass("selected");
$(_radioInput).attr("value", "true");
},
};
};
var radioButtonsOne = new radioButtons();
$(document).ready(function(){
radioButtonsOne.inputCounter("#radioButtonsGroup");
});
Its a custom function I wrote for custom Radio buttons. I have a similar one for Checkboxes buttons. It works perfectly in all browsers except for IE7. It tells me that radioButtonsOne
is not defined. But it is though. Any idea why?
Thank!