Fork me on GitHub

Example: Basic phone field creation

How to create a phone field.

Basic PhoneField creation

Use the following code to create a basic inputEx PhoneField.(Try it on a mobile phone !!!)

Another basic PhoneField creation with font awesome

(don't forget to load font awesome)

HTML

<div class='demoContainer' id='container1'></div>
<div class='demoContainer' id='container2'></div>

JavaScript

Implementation

YUI().use('inputex-phone', function(Y) {
    
    // example 1
    new Y.inputEx.PhoneField({parentEl: 'container1', label: 'Phone number'});

	// example 2
    new Y.inputEx.PhoneField({parentEl: 'container2', label: 'Phone number', button : { label : '<i class="fa fa-phone"></i>' }});

});