16825 |
efrain |
1 |
<!DOCTYPE html>
|
|
|
2 |
<html>
|
|
|
3 |
<head>
|
|
|
4 |
<meta charset="utf-8">
|
|
|
5 |
<title>Example: Display an existing number</title>
|
|
|
6 |
<link rel="stylesheet" href="../css/prism.css">
|
|
|
7 |
<link rel="stylesheet" href="../../build/css/intlTelInput.css?1603274336113">
|
|
|
8 |
<link rel="stylesheet" href="../../build/css/demo.css?1603274336113">
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
<!-- GOOGLE ANALYTICS -->
|
|
|
12 |
<script>
|
|
|
13 |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
|
14 |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
|
15 |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
|
16 |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
|
17 |
ga('create', 'UA-85394876-1', 'auto');
|
|
|
18 |
ga('send', 'pageview');
|
|
|
19 |
</script>
|
|
|
20 |
<!-- /GOOGLE ANALYTICS -->
|
|
|
21 |
</head>
|
|
|
22 |
|
|
|
23 |
<body>
|
|
|
24 |
<a href="/">Back</a>
|
|
|
25 |
<h1>Example: Display an existing number</h1>
|
|
|
26 |
<p>We initialise the plugin on an input which already contains a full international number. The plugin will automatically select the relevant flag, and re-format the number to national format.</p>
|
|
|
27 |
|
|
|
28 |
<h2>Markup</h2>
|
|
|
29 |
<pre><code class="language-markup"><input id="phone" type="tel" value="+447733312345">
|
|
|
30 |
</code></pre>
|
|
|
31 |
|
|
|
32 |
<h2>Code</h2>
|
|
|
33 |
<pre><code class="language-javascript">var input = document.querySelector("#phone");
|
|
|
34 |
window.intlTelInput(input, {
|
|
|
35 |
utilsScript: "../../build/js/utils.js?1603274336113" // just for formatting/placeholders etc
|
|
|
36 |
});
|
|
|
37 |
</code></pre>
|
|
|
38 |
|
|
|
39 |
<h2>Result</h2>
|
|
|
40 |
<div id="result">
|
|
|
41 |
<input id="phone" type="tel" value="+447733312345">
|
|
|
42 |
|
|
|
43 |
</div>
|
|
|
44 |
|
|
|
45 |
<script src="../js/prism.js"></script>
|
|
|
46 |
<script src="../../build/js/intlTelInput.js?1603274336113"></script>
|
|
|
47 |
<script src="./js/displayNumber.js?1603274336113"></script>
|
|
|
48 |
</body>
|
|
|
49 |
</html>
|