well, its always better to use combination of js and php, cause u dont want the script to go to the action page if nothing is entered and do error checking cause its a waste of the servers resources.
//test.php
<script language=javascript>
function check(){
if(document.test_form.f_name.value==''){
alert("cant leave first name blank");
document.test_form.f_name.focus();
return false;
}
document.test_form.submit();
}
</script>
<form name="test_form" method="post" action="test_action.php">
<input type=text name="f_name">
<input type=button name="submit" onClick="java script:check();" value="submit">
</form>
//test_action.php
<?php
if(isSet($_POST['f_name'])){
if($_POST['f_name']==""){
echo "f_name is blank";
exit;
}else{
echo "f_name is ".$_POST['f_name'];
}
}else{
echo "f_name is not set";
exit;
}
?>
reg
kevin