2.0中:
</form>
支持ie,firefox
<script>
function isEnter(ev)
{
var ev = ev ||
window.event;
var keycode;
if(window.event) keycode = ev.keyCode;
else
keycode = ev.which;
if(keycode == 10 || keycode == 13) return true;
else
return false;
}
</script>
<input type="text"
onkeydown="if(isEnter(event)){btn1.click();return false;}" /><input
id="btn1" type="button" value="提交" />
Page.RegisterStartupScript("focus","<script
language=javascript>document.all(‘文本控件的ID‘).focus()</script>");
时间: 2024-10-05 17:09:32