summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/input-number-localization.html
blob: 4647aa57d423879241134d41bf04876fc2cf55a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head>
<title>Number type input shows and accepts localized numbers</title>
<style>
:invalid {
  border-color: red;
  -webkit-box-shadow: 4px 4px 8px #ff8888;
}
</style>
</head>
<body>
<div id="console"></div>

<p>Output test: The following text field should have a localized representation for "-1234.56".
e.g. "-1,234.56" for en_US locale, "-1.234,56" for fr_FR locale.</p>
<div><input type=number value="-1234.56" step=any></div>

<p>Input test: Type a localized representation of a number into the following text field.
You'll see an equivalent number in the standard format on the bottom of the text field.</p>
<div><input type=number id=target step=any oninput="handleInput()"></div>
<div>Standard format: <output id=output></output></div>

<script>
function handleInput() {
  document.getElementById('output').value = document.getElementById('target').value;
}
</script>
</body>
</html>