Código PHP:
<head>
<script language="JavaScript">
function jsvalida()
{
if(document.frm.texto.value=="")
{
alert("ingrese valor..");
document.frm.texto.focus();
return false;
}
return true;
}
function jsaccion()
{
if (jsvalida())
{
var strUrl = "http://www.algo.com/pagina.html";
document.frm.action=strUrl;
document.frm.submit();
}
}
</head>
</script>
<body>
<form name=frm>
<input type=text name=texto value==>
<input typee=button value=aceptar onclick="javascript:jsaccion();">
</body>
saludos.