Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

'tagName' is null or not an object in IE8. not validating radio buttons in IE8

newb_123newb_123 IndiaPosts: 0Member

Hi, I am using validatious-custom-0.9.1.js framework in my project and I am trying to validate required fields for radio buttons. But it is not validating the radio buttons in IE8. I am getting the following error in console Message: 'tagName' is null or not an object Line: 7 Char: 9921 Code: 0 URI: http://validatious.org/design/js/val....js?1256063644

HTML code used.

JS where it is failing - First 2 are the examples that are given in the framework file. So you will get to know how it is implemented

/* A radio button field is assumed to be either a list - ordered or unordered - with some element in front that acts as a label. This may be any element. If it is not in a list (ie the element does not have "li" parent elements), the label is assumed to be the element before the first input element.

Example1 (list approach):

<

h2>Favourite food/h2>

getLabel() will in this case return the h2 element.

Example2 (no list).

getLabel() will in this case return the first label element */

Actual code

getLabel: function() { var parent = this.__elements[0].parentNode; //alert(parent1.nodeName); --- Gives 'nodeName' is null or not an object IN Ie8 if (parent1.tagName.toLowerCase() === 'li') { ---Gives 'tagName' is null or not an object return v2.$(parent1.parentNode).previous(); }

var element = v2.$(this.__elements[0]).previous(); return element || this.base(); }

Required field validation in the js file

v.reg('required', function(field, value, params) { return !v2.empty(value) && !(typeof value.length !== 'undefined' && value.length == 0);

}, null, null, 'not-empty', false);

It works fine in firefox, IE7 and IE9. But in IE8, I get message tagName is null or not an object.

Can somebody please help me why its is giving error in IE8

Thanks in advance..

Tagged:
Sign In or Register to comment.