Block enter textfield : TextField : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » TextField »

 

Block enter textfield



<html>
<head>
<SCRIPT LANGUAGE="JavaScript"


function blockEnter(evt) {
    evt = (evt? evt : event;
    var charCode = (evt.charCode? evt.charCode :((evt.which? evt.which : evt.keyCode);
    if (charCode == 13) {
        return false;
    else {
        return true;
    }
}
</SCRIPT
</head>
<body>
<form>

<input type="text" name="search" size="40" onkeydown="return blockEnter(event)" />
</form>
</body>
</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» TextField