Hola
Prueba así
Código:
<form id="reg" name="formulario" method="post" action='<?php echo $_SERVER['PHP_SELF'] ?>' onSubmit="return verifica(this);">
A la función se la ha pasado un argumento
Código PHP:
function verifica(f)
{
var oknick = f.nick.value != "";
if(!oknick)
{
alert("El campo nombre esta vacio");
//y aqui viene la respuesta a tu pregunta
document.getElementById('nick').style.border = 'thin solid #FF0000';
return false; //no se realiza el submit
}
var okpass = f.pass.value != "";
if(!okpass)
{
alert("El campo pass esta vacio");
//y aqui viene la respuesta a tu pregunta
document.getElementById('pass').style.border = 'thin solid #FF0000';
return false; //no se realiza el submit
}
var okdia = f.dia.value != "";
if(!okdia)
{
alert("Selecione su dia de nacimiento");
//y aqui viene la respuesta a tu pregunta
document.getElementById('dia').style.border = 'thin solid #FF0000';
return false; //no se realiza el submit
}
etc.....
Suerte