<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<base target="_self">
<title>货品定位</title>
<link rel="stylesheet" href="jsp/resource/css/cjpm.css">
<script type="text/javascript">
function tab()
{
if(event.keyCode==13)
{event.keyCode=0;
document.getElementById('inp').focus();
var inp=document.getElementById('inp').value;
alert(inp);
var sel=document.getElementById('sel');
sel.options[sel.options.length]=new Option(inp, inp);
return false;
}
}
function del(){
var sel=document.getElementById('sel');
sel.options.remove(sel.selectedIndex);
}
</script>
</head>
<body onkeydown= "if(event.keyCode==13) event.keyCode=0;return false;" background="jsp/resource/image/bg.gif">
<form methed="get" action="nihao...">
<table border=0 cellspacing=0 cellpadding=2 width="100%"
bgcolor="gray">
<tr>
<td class="headerbar61">
货品定位
</td>
<td class="headerbar61">
<p align="right"> </p>
</td>
</tr>
</table>
<table border=0 cellspacing=0 cellpadding=2 width="100%" height="5">
<tr>
<td></td>
</tr>
</table>
<table border=0 cellspacing=1 cellpadding=2 width="46%">
<tr>
<td width="15%" align="right" class="textbar01"><input name="textfield" type="text" size="30" onKeyDown="tab()" tabindex="1" id="inp"></td>
<td class="textbar01"></td>
</tr>
<tr>
<td align="right" class="textbar01"><select name="select" multiple="multiple" id="sel" style=" width:210px;" tabindex="2" ondblclick="del()">
<option id="01" value="qqq">asda444</option>
</select> </td>
<td align="right" class="textbar01"> </td>
</tr>
</table>
<!--页码信息显示区 end-->
</form>
</body>
</html>
加一句 if(event.keyCode==13)
{
window.event.returnValue= false;
页面有文本框,单击回车能提交页面
最新推荐文章于 2025-08-13 21:05:35 发布