Hola Facundo.
Prueba esto y revisalo, no es dificil:
Código PHP:
<html>
<head>
<script language='JavaScript'>
function validar(){
with (document.frm){
if (texto.value == ''){
alert('Debe escibir algún valor');
texto.focus();
} else submit();
}
}
</script>
</head>
<body>
<form name='frm'>
Texto:
<input type='text' name='texto'><br>
<input type='button' value='Validar' onclick='validar()'>
</form>
</body>
</html>
Saludos.