...

View Full Version : alert when pressing TAB



zodehala
09-01-2008, 12:39 PM
when i pressed tab (while on textfield and not on ) i wanna open an alert dialog . is it possible ?


<form id="form1" name="form1" method="post" action="">
<label>
<input type="text" name="textfield" />
</label>
</form>

Philip M
09-01-2008, 01:01 PM
<script type="text/javascript">
function codeNum(e){
if(!e) {e = window.event}
if(e.keyCode) {alert(e.keyCode)}
else {alert(e.charCode)}
if ((e.keyCode == 9) || (e.charCode == 9)) {
alert ("You pressed the tab key");
}
}
</script>

<input type="text" id = "txt1" size = "50" onkeydown="codeNum(event)"/>
</body>


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

zodehala
09-03-2008, 02:45 PM
thanx for reply but i can not do it for regex

Philip M
09-03-2008, 04:16 PM
thanx for reply but i can not do it for regex

Sorry, I do not understand. :confused:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum