Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

Polymer Gold Phone Input

The Polymer gold-phone-input element is a simple text field, used to specify phone number. It is styled in Material Design.

Syntax:

Validation

To validate a phone number, use the pattern XXX-XXXXXXX, where "X" is a digit and "-" is a separator. By default, this specifies a US phone number. To use different number patterns, use the attributes country-code and phone-number-pattern like this:

The validate() method is used to validate phone number manually. It returns true if it is valid otherwise false, if it is not valid. You can use auto-validate and required attributes to make the input to be automatically validated.

Example

Run the following command to install gold-phone-input element in your project directory. After that you can use this element in your application:

gold phone input

It will install all the related elements of polymer_gold-phone-input under the bower_components folder.

Create an index.html file and add the following code in it to see the usage of gold-phone-input element in Polymer.js.

Output:

gold phone input 2
Next TopicNeon Elements





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA