七彩课堂[网页设计教程系列]
代有eWebEditor的表单验证
    代有eWebEditor的表单验证
<script language="javascript">
function a()
{
var obj=document.getElementById("classid")
if(obj.options[obj.selectedIndex].value==2)
document.getElementById("tradeid").style.display="";
else
document.getElementById("tradeid").style.display="none";
//alert("aaa");
}
function check()
{
if(document.trade.title1.value=="")
{
alert("请填加主题");
trade.title1.focus();
return false;

}
var content1=eWebEditor1.eWebEditor.document.body.innerHTML;
if(content1.length < 1){
alert("请填写内容!");
eWebEditor1.eWebEditor.focus();
return (false);
}

}
</script>
<table width="100%" align="left" cellpadding="7" cellspacing="0" class="form_tab">
<form action="news_save.asp" method="post" name="trade" id="trade" >
<tr>
<td width="158" align="right" class="form_tab_td"><span class="textC041B8F">标题:</span></td>
<td width="1127" align="left"><input name="title1" type="text" class="bdkuang" id="title1" style="width:480px" /></td>
</tr>
<tr>
<td width="158" align="right" class="form_tab_td"><span class="textC041B8F">类别:</span></td>
<td width="1127" align="left">
<select name="classid" id="classid" onChange="a()">
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from news_class"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
%>
<option value="<%=rs("classid")%>"><%=rs("class_name")%></option>
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</select>
<select name="tradeid" id="tradeid" style=" display:none;">
<%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from news_trade order by tradeid asc"
rs1.open sql1,conn,1,1
if not rs1.eof then
do while not rs1.eof
%>
<option value="<%=rs1("tradeid")%>"><%=rs1("trade_name")%></option>
<%
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
%>
</select></td>
</tr>
<tr>
<td align="right" class="form_tab_td">&nbsp;</td>
<td align="left"><textarea name="content" cols="50" rows="4" id="content" style="display:none"></textarea>
<iframe ID="eWebEditor1" src="../editor/eWebEditor.asp?id=content&style=s_3d" frameborder="0" scrolling="no" width="550" HEIGHT="350"></iframe></td>
</tr>
<tr>
<td align="right"></td>
<td align="left"><input id="Button1" type="submit" value="确定发布" name="Button1" onClick="return check();"/> </td>
</tr>
</form>
</table>

 
信息推荐
资讯中心 | 电子商务 | 搜索营销 | 设计学院 | 中医养生 | 养生保健 | 节日祝福 | 民俗文化 | 奇闻趣事
建站知识 | 人世百态 | 网站导航 | 传统节日 | 搜索热点 | 星座运势 | 趣闻轶事 | 祝福的话 | 短信大全
© 2023 QicaiSpace.Com