cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ping-yang
New member
Status: New idea

Consider an input field with a date value already present in it.

<html>
	<head>
		<title>Date input bug test</title>
	</head>
	<body>
		<form id="test-form">
			<input type="date" onchange="document.getElementById('test-form').submit()" value="2022-01-01">
			<input type="submit" value="Send">
		</form>
	</body>
</html>

If you start with an empty field (in the example above, you can remove the value attribute to test it) the onchange event will only be triggered when you click on the day.  It will let you change the month/year.
But when you click on a date input which already has a value (as in the example above) to make the date picker appear, and that you change the month/year this will trigger the onchange event as soon as the month/year are changed.

Is that the expected behaviour ?
For example on Chrome, if you try the above example, the onchange event will only be triggered when you click on the day - Chrome will let you select a new month/year and only trigger the onchange event when you click on the day, regardless of if the input field had a value or not.

1 Comment
KevinBrosnan
Employee
Employee

This would be best filed as a bug at https://bugzilla.mozilla.org/enter_bug.cgi