<?php
$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" );
?>
<caption>
<h2>布置作业</h2>
</caption>
<tr>
<th style="text-align: left">课程名称:</th>
<td><input type="text" name="cname" id="cname"
style="border-color: #FCC898; border-width: 3px; border-style: solid; font-weight: normal; width: 400px;">
</td>
</tr>
<tr>
<th style="text-align: left">任课老师:</th>
<td><select name="tname" id="tname">
<option value='0' selected>请选择</option>
<?php
$sql = "select tname from tblteacher";
$result = mysql_query ( $sql );
while ( $row = mysql_fetch_assoc ( $result ) ) {
?>
学 院:
<tr>
<th style="text-align: left">实验名称:</th>
<td><input type="text" name="pname" id="pname"
style="border-color: #FCC898; border-width: 3px; border-style: solid; font-weight: normal; width: 400px;">
</td>
</tr>
<tr>
<th style="text-align: left">实验目的:</th>
<td><textarea cols="58" rows="4" name="paim" id="paim"
cellspacing="0"
style="border-color: #FCC898; resize: none; border-width: 3px; border-style: solid; font-weight: normal; width: 400px;"></textarea>
</td>
</tr>
<tr>
<th style="text-align: left">实验内容:</th>
<td><textarea cols="58" rows="4" name="pcontent" id="pcontent"
cellspacing="0"
style="border-color: #FCC898; resize: none; border-width: 3px; border-style: solid; font-weight: normal; width: 400px;"></textarea>
</td>
</tr>
<tr>
<th style="text-align: left">实验步骤:</th>
<td><textarea cols="58" rows="4" name="pstep" id="pstep"
cellspacing="0"
style="border-color: #FCC898; resize: none; border-width: 3px; border-style: solid; font-weight: normal; width: 400px;"></textarea>
</td>
</tr>
<tr>
<th style="text-align: left">实验结果:</th>
<td><textarea cols="58" rows="4" name="presult" id="presult"
cellspacing="0"
style="border-color: #FCC898; resize: none; border-width: 3px; border-style: solid; font-weight: normal; width: 400px;"></textarea>
</td>
</tr>
<tr>
<th style="text-align: left">分析讨论:</th>
<td><textarea cols="58" rows="4" name="panalyse" id="panalyse"
cellspacing="0"
style="border-color: #FCC898; resize: none; border-width: 3px; border-style: solid; font-weight: normal; width: 400px;""></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="提交"> <input
type="reset" value="重置" onclick="Reset()"></td>
</tr>
</table>
</form>
请选择 <?php $sql = "select colname from college"; $result = mysql_query ( $sql ); while ( $row = mysql_fetch_assoc ( $result ) ) { ?> 专 业: | 请选择 <?php $sql = "select pro_name from pro"; $result = mysql_query ( $sql ); while ( $row = mysql_fetch_assoc ( $result ) ) { ?> 年 级: | 请选择 <?php $sql = "select sgrade from tblstudent"; $result = mysql_query ( $sql ); while ( $row = mysql_fetch_assoc ( $result ) ) { ?> 截止日期: | 年 月 日 |
js里验证非空2种方式 第一种判断长度是不是大于0 即length>0
第二个 比对 =='' 或者 !=null
描述的太乱了
一般而言, JS 中的 判空可以使用 s != null 或者 typeOf(XX)!=undefined 的方式
参见:
blog.csdn.net/oscar999/article/details/9353713
最好用JS或者jq
用户名非空验证
function checkUserName(){
var name = document.myform.txtUser; //在这里我认为: name 代表的name 为 txtUser 的文本框
if(name.value.length==0){
alert("请输入用户名");
name.focus();
return false;
}else{return true;}
}
js中判断用户登录文本框是否为空的两种方法js中判断用户登录文本框是否为空的两种方法
代码比较乱啊。
判断是否为空可以这样写
if(document.getElementById('aaa').value==''){
... 为空。
}```