Validating a single radio button is not working in available javascript validation script Part-2

Posted by OM The Eternity on Stack Overflow See other posts from Stack Overflow or by OM The Eternity
Published on 2011-01-11T06:26:53Z Indexed on 2011/01/11 6:53 UTC
Read the original article Hit count: 235

Hi All

I am available with the solution given by @Tomalak for MY QUESTION could you pls help me out with it as its giving me an error in firebug as : frm.creatorusers is undefined [Break On This Error] var rdo = (frm.creatorusers.length >...rm.creatorusers : frm.creatorusers; I used the code for validating radio button as:

function valDistribution(frm) {
var mycreator = -1;
        var rdo = (frm.creatorusers.length > 0) ? frm.creatorusers : frm.creatorusers; 
         for (var i=0; i<rdo.length; i++) {
         if (rdo[i].checked) {
         mycreator = 1;
            //return true;
          }
          }
          if(mycreator == -1){
          alert("You must select a Creator User!");
  return false;

          }

}

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about validation