Hello,

I'm using a validation script from http://www.vicsjavascripts.org.uk/Fo...FormVerify.htm to validate about 20 group of radio buttons, the code is working great when I tried it on a small test page but it is not working on my actual page probably bec. my radio buttons are in an array.

Could you please check it and give me some suggestions or alternatives?

Code:
<script language="JavaScript" type="text/javascript">
<!--
// Customising Varibles
var f55TrueBGColor='#f8cd76'; // the verifly true background color - null if not required (color, string)
var f55FalseBGColor='red';	// the verifly false background color - null if not required (color, string)
 
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
// Verify Form f55Part2 (04-Feb-2005)
// by Vic Phillips http://www.vicsjavascripts.org.uk/
// Functional Code for Basic Verification- NO NEED to Change
function f55Verify(f55frm,f55alt){
if (typeof(f55frm)=='string'){ f55frm=document.f55frm; }
var f55els,f550,f55mess,f55ck;
var f55messary=[];
var f55all='';
if (f55frm.fail){ f55RemoveMarker(f55frm.fail); }
f55frm.ary=[];
f55els=f55frm.elements;
for (f550=0;f550<f55els.length;f550++){
if (f55els[f550].name&&!f55els[f550].className.match('f55exc')&&!f55els[f550].exc){
if (f55FalseBGColor){ f55els[f550].style.backgroundColor=f55FalseBGColor; }
f55els[f550].mnme=f55els[f550].name;
if (f55els[f550].title){ f55els[f550].mnme=f55els[f550].title; }
f55els[f550].nme=f55els[f550].name.replace('[]','');
if (!f55all.match(f55els[f550].nme)){ f55frm.ary.push(f55els[f550]); window['f55'+f55els[f550].nme]=''; window['f55ary'+f55els[f550].nme]=[]; }
window['f55ary'+f55els[f550].nme].push(f55els[f550]);
f55els[f550].pass=false;
if (f55els[f550].type=='text'||f55els[f550].tagName=='TEXTAREA'){
	f55mess=false;
	if (f55els[f550].special){ f55mess=true; f55Special(f55els[f550],f55messary); }
	if (!f55mess){
	 f55mess=f55els[f550].mnme+'\n'+(f55els[f550].mess||'Please Complete');
	 f55messary.push(f55mess);
	 if (f55els[f550].value.length>0){
	 f55messary.length--;
	 f55els[f550].pass=true;
	 }
	}
	f55CkBGColor(f55els[f550]);
}
if (f55els[f550].type=='radio'||f55els[f550].type=='checkbox'){
	if (f55els[f550].mm){ f55Special(f55els[f550],f55messary); }
	else {
	 f55mess=f55els[f550].mnme+'\n'+(f55els[f550].mess||'Please Check One');
	 if (!f55all.match(f55els[f550].nme)){ f55messary.push(f55mess); }
	 if (f55els[f550].checked){
	 f55messary=f55messary.remove(f55mess);
	 window['f55ary'+f55els[f550].nme][0].pass=true;
	 }
	}
	f55CkBGColor(f55els[f550]);
}
if (f55els[f550].tagName=='SELECT'){
	f55mess=f55els[f550].mnme+'\n'+(f55els[f550].mess||'Please Select');
	if (f55els[f550].selectedIndex<1){ f55messary.push(f55mess); }
	else { f55els[f550].pass=true; }
	f55CkBGColor(f55els[f550]);
}
if (!f55all.match(f55els[f550].nme)){
	f55all+=f55els[f550].nme+',';
}
}
}
if (f55messary.length>0){
if (f55frm.mark){ f55Marker(f55frm); }
if (f55alt){ alert(f55messary.join('\n\n')); }
return false;
}
return true
}
function f55CkBGColor(f55bgobj){
if (!f55TrueBGColor){ return; }
var f55col=f55FalseBGColor
if (window['f55ary'+f55bgobj.nme][0].pass){ f55col=f55TrueBGColor; }
for (f551=0;f551<window['f55ary'+f55bgobj.nme].length;f551++){
window['f55ary'+f55bgobj.nme][f551].style.backgroundColor=f55col;
}
}
Array.prototype.remove=function(f55ary){
var f55ary0;
for (f55ary0 in this){ if (this[f55ary0]==f55ary){ this.splice(f55ary0,1); } }
return this
}
//-->
</script>

HTML Code:
1. question1
<input name="a[1]" type="radio" value="1">
	 option 1 <br>
<input name="a[1]" type="radio" value="2">
	 option 2 <br>
 
2. question2
<input name="a[2]" type="radio" value="1">
	 option 1 <br>
<input name="a[2]" type="radio" value="2">
	 option 2 <br>
Thank You