<?phpif ($tuvariable=='') {?><script type="text/javascript">alert('El campo está vacío');</script><?php } ?>