Open Bug 732694 Opened 12 years ago Updated 2 years ago

KeyEvent for tab key not work

Categories

(Core :: DOM: Events, defect, P5)

10 Branch
x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: bstec, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120215223356

Steps to reproduce:

I write page:
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
  <form name="comment1" id="comment1" action="action.php" method="POST">
	<input name="dane1" id="dane1" type="text" onkeydown="javascript:next_field(event,1);">
	<input name="dane2" id="dane2" type="text" onkeydown="javascript:next_field(event,2);">
	<input name="dane3" id="dane3" type="text" onkeydown="javascript:next_field(event,3);">
	<input name="dane4" id="dane4" type="text" onkeydown="javascript:next_field(event,4);">
  </form>
 <script language='JavaScript' type='text/javascript'>
 function next_field(event,nr) {
	 var Key = ('which' in event) ? event.which : event.keyCode;
	 if (Key==13) {
		el=document.getElementById("dane"+nr);
		var evt = document.createEvent("KeyboardEvent");
		evt.initKeyEvent("keypress", true, true, null, false, false, false, false, 0, 65);
		el.dispatchEvent(evt);
	 }
 }
 </script>
 </body>
</html>

It is work.
When i change line with initKeyEvent to one from following:
		evt.initKeyEvent("keypress", true, true, null, false, false, false, false, 0, 9);
or
		evt.initKeyEvent("keypress", true, true, null, false, false, false, false, 9, 9);
or
		evt.initKeyEvent("keypress", true, true, null, false, false, false, false, 9,9);
it's not work



Actual results:

Nothing is happen


Expected results:

Cursor could go to next field
Does this work in other browsers ?
initKeyEvent is implemented only in Mozilla
Component: Untriaged → DOM: Events
Product: Firefox → Core
QA Contact: untriaged → events
Chances are the tabbing code only looks at trusted events....
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: