head meta http-equiv =content-type content =text/html; charset=utf-8 / title 无标题文档 / title script type =text/javascript function checksubmit() { var kw = document.getelementbyid( ' kw ' ).value; if (kw.length 1 ) { alert ( ' 请
head>
meta http-equiv=content-type content=text/html; charset=utf-8/>
title>无标题文档title>
script type=text/javascript>
function checksubmit() {
var kw = document.getelementbyid('kw').value;
if (kw.length 1) {
alert('请输入!');
returnfalse;
}
returntrue;
}
script>
head>
body>
div id=fm>
form name=free method=get action='news.php' onsubmit=return checksubmit();>
input type=text name=edit class=style2 id=kw maxlength=150>
span class=btn_wr>
input type=submit class=btn id=su value=检 索>
span>
form>
div>
body>
html>
首先判断输入框edit的内容是否为空,若非空跳转到news.php页面,且把值传给news.php中的edit2。
以上代码该怎么写。本人是php初学,请大哥大姐指点。。。