funtion test(obj){ obj.onblur=function(){ if(!obj.value.match(re)){ obj.style.border='1px solid red';} else{obj.style.border='';} }}test(oIpt1);test(oIpt2);test(oIpt3);