Example:-
<script type="text/javascript" language="javascript">
function handleEnter (obj, event)
{
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if (keyCode == 13)
{
document.getElementById(obj).click();
return false;
}
else {
return true;
}
}
</script>
Relevant codes
protected void Page_Load(object sender, EventArgs e)
{
TextBox1.Attributes.Add("onkeypress", "return handleEnter('" + Button1.ClientID + "', event)");
}
'TextBox'에 해당되는 글 1건
카테고리 없음2014. 4. 2. 18:12