欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php-JS判断文本框是否是空的问题,为什么我的代码不能判断,就指点

程序员文章站 2022-06-14 20:00:37
...
phphtmljavascrpit

$conn = mysql_connect ( 'localhost', 'root', 'admin' ) or die ( 'could not connect: ' . mysql_error () );
mysql_select_db ( 'sybgtjxt' ) or die ( 'could not select database' );
mysql_query ( "set names gbk" );

?>


实验报告提交系统
h2, font { font-style: oblique; color: #FCC898; font-weight: normal id=top; valign =top; position: relative;}function YanZheng() { var cname = document.getElementById("cname").value; var tname = document.getElementById("tname").value; var ppro = document.getElementById("ppro").value; var pgrade = document.getElementById("pgrade").value; var pcol = document.getElementById("pcol").value; //var pcutdate = document.getElementById("pcutdate").value; var pname = document.getElementById("pname").value; var paim = document.form1.paim.value; var pcontent = document.getElementById("pcontent").value; var pstep = document.getElementById("pstep").value; var panalyse = document.getElementById("panalyse").value; var presult = document.getElementById(" presult").value; //这个功能没实现 if (cname=="") { window.alert("请输入所有内容"); return false; } } function Reset() { document.getElementById("cname").value = ""; document.getElementById("tname").value = 0; document.getElementById("ppro").value = 0; document.getElementById("pgrade").value = 0; document.getElementById("pcol").value = 0; document.getElementById("pcutdate").value = ""; document.getElementById("pname").value = ""; document.getElementById("paim").value = ""; document.getElementById("pcontent").value = ""; document.getElementById("pstep").value = ""; document.getElementById("panalyse").value = ""; document.getElementById("presult").value = ""; } function YYYYMMDDstart() { MonHead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; //先给年下拉框赋内容 var y = new Date().getFullYear(); for (var i = (y-30); i =1&&i

onsubmit="return YanZheng();">
        

        

布置作业

课程名称:
任课老师:
请选择
$sql = "select colname from college";
$result = mysql_query ( $sql );
while ( $row = mysql_fetch_assoc ( $result ) ) {
?>

专    业:


请选择
$sql = "select pro_name from pro";
$result = mysql_query ( $sql );
while ( $row = mysql_fetch_assoc ( $result ) ) {
?>

年    级:


请选择
$sql = "select sgrade from tblstudent";
$result = mysql_query ( $sql );
while ( $row = mysql_fetch_assoc ( $result ) ) {
?>

截止日期:







实验名称:
实验目的:
实验内容:
实验步骤:
实验结果:
分析讨论: