i try it but when function return false it should stay on same page
編集 :
<?php
$_POST['f_name'] = 'stack';
$_POST['job'] = 'over';
$count1 = 'flow';
$valid_m = 10;
?>
<script language='JavaScript' type='text/JavaScript'>
function Hello()
{
if ((document.f1.f_name.value == '') || (document.f1.job.value == '')) {
alert('Please fill all fields');
return false;
}
if ((1 > '<?php echo $valid_m ?>')) {
alert('you should <?php echo $valid_m ?>, upload your sick leave letter');
return false;
}
return true;
}
</script>
<input type=button onClick="if(Hello(this)) location.href='go.php?f_name=<?php echo $_POST['f_name']; ?>&job=<?php echo $_POST['job']; ?>&id_up=<?php echo $count1;?>'" value='Save'>