Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onEnter

Status
Not open for further replies.
Apr 14, 2004
22
US
When I hit Enter instead of a Tab key, then my web application go to another form. I would like to the next field. Or Operate as a tab key. How do I make this to work.

This application is written in vb.net.

Thank you

Salim Bhura
 
Here's one example:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]

<html>
<head>
<title>new document</title>

<script language="javascript" type="text/javascript">
<!--

function tabNext(e, i) {
    if (e.keyCode == 13)
	    document.forms['f'].elements[i].focus();
	return false;
}

-->
</script>

<style type="text/css">

</style>

</head>

<body>
<form name="f">
  <input type="text" name="t1" onkeypress="return tabNext(event, 't2');" /><br />
  <input type="text" name="t2" onkeypress="return tabNext(event, 't3');" /><br />
  <input type="text" name="t3" onkeypress="return tabNext(event, 't4');" /><br />
  <input type="text" name="t4" onkeypress="return tabNext(event, 's');" /><br />
  <input type="submit" name="s" />
</form>
</body>

</html>

*cLFlaVA
----------------------------
"Holy crip he's a crapple!
 
Hi,

My form is a form.aspx . This page don't have a keydown event.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top