请您写出一段html/js代码, 实现下面的页面功能 请您写出一段html/js代码, 实现下面的页面功能:一个商品查询界面, 包含一个产品编码输入框. 用户可以点击提交按钮或者直接回车实现提交; 提交时, 如果输入框没有输入, 则用消息窗口提示用户”请先输入”并停止提交. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <input type="text" onsubmit="test(this)"/><script>function test(o){ if(o.value==""){alert("请先输入");return false;} else return true;}</script> <input type="text" id="aaa" onsubmit="test"/><input type="submit"<script>function test(){ var a = document.getElementById("test").value; if(a ==""){alert("请先输入");return false;} else return true;}</script> 好像你们都忽略了个回车提交...至少触发事件的时候也看看keyCode等于13不撒!! <form onsubmit="test"><input type="text" id="aaa"/><input type="submit" /></form><script>function test(){ var a = document.getElementById("test").value; if(a ==""){alert("请先输入");return false;} else return true;}</script> <table border="0"> <tr> <td>产品编码:</td> <td><input type="text" id="code" /></td> </tr> <tr> <td> </td> <td><input type="submit" value="查询" onclick="search()" /> </td> </tr></table><script type="text/javascript">function search(){ if(document.getElementById("code").value=="") { alert("请先输入!"); document.getElementById("code").focus; return false; }}</script>按钮类型为submit默认回车提交的 这年代赚分真不容易<form onsubmit="test"><input type="text" id="aaa"/><input type="submit" /></form><script>function test(){ var a = document.getElementById("test").value; if(a ==""){alert("请先输入");return false;} else return true;}</script> setTimeout(,)浏览器不执行期中的代码 在HTML中设定没做超链接的flash的链接 EXT问题 大家帮帮忙了 fous() 急,怎么访问jquery.load取回后的html元素 如何让一个下拉框不能选择,就象文本设为readonly一样 这样写不行吗?? 如何把一文件的全部内容存在一变量中??? 急急!!!!!!!各位大虾:我怎么在单击一按钮提交一个表单的同时关闭前的页面?UP有分 google地图,框选是一个矩形,已知东北西南经纬度,求西北东南经纬度 内有黑丝MM,让我快乐我换红丝!!! js 闭包!不要贴链接,根据自己的理解讲解下,最好是有代码有注释
<script>
function test(o){
if(o.value==""){alert("请先输入");return false;}
else return true;
}
</script>
<input type="text" id="aaa" onsubmit="test"/>
<input type="submit"
<script>
function test(){
var a = document.getElementById("test").value;
if(a ==""){alert("请先输入");return false;}
else return true;
}
</script>
<input type="text" id="aaa"/>
<input type="submit" />
</form>
<script>
function test(){
var a = document.getElementById("test").value;
if(a ==""){alert("请先输入");return false;}
else return true;
}
</script>
<tr>
<td>产品编码:</td>
<td><input type="text" id="code" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="查询" onclick="search()" />
</td>
</tr>
</table>
<script type="text/javascript">
function search(){
if(document.getElementById("code").value=="")
{
alert("请先输入!");
document.getElementById("code").focus;
return false;
}
}
</script>
按钮类型为submit默认回车提交的
<form onsubmit="test">
<input type="text" id="aaa"/>
<input type="submit" />
</form>
<script>
function test(){
var a = document.getElementById("test").value;
if(a ==""){alert("请先输入");return false;}
else return true;
}
</script>