function post()
{
if(document.form('searname').value=='')
{
alert("Please enter the keywords!");
document.form('searname').focus();
return false;
}
}
echo '<form method="post" action="search_admin_database.php" onsubmit="return post()">' . "\n\n";
答:晕,function post是PHP函数还是JS函数,这是从哪里学来的呢?
function post()
{
if(document.f1.searname.value=='')
{
alert("Please enter the keywords!");
document.form('searname').focus();
return false;
}
}
<form name="f1" id="f1" method="post" action="search_admin_database.php" onsubmit="return post()">
【完】