javascript - onFocus not calling function in Chrome, safari, FF, working fine in IE* -
here in these piece of code m trying validate fields bycalling function when onfocus... html code below:
<a href="#" onmouseout="mm_swapimgrestore()" onmouseover="mm_swapimage('image4','','./images/search1.gif',1)" onclick="clicksearch('company','branchcode','companynameopr','companyname','isactive')" onfocus="commonsearchvalidation('company','companyname','branchcode','isactive'),chkspecial('company'),chkspecial('branchcode')">
the function m calling,,, , function having code below:
function commonsearchvalidation() { alert("commonsearchvalidation"); var counter=arguments.length; alert(counter); var resflag = false; for(var i=0 ; < counter ; i++) { var fvalue = document.getelementbyid(arguments[i]).value; if(fvalue.trim().length!=0) { resflag = true; } } if(resflag) { return resflag; } else { alert(enteronefield); document.getelementbyid(arguments[0]).focus(); return resflag; } }
please guys me out..
Comments
Post a Comment