Element: <ins-input-tel>
Defines an input field where user can enter phone number data.
Code Snippet
<ins-input-tel label="Phone" areacode-placeholder="Area Code" areacode-value="1300" phonenum-placeholder="Phone Number" phonenum-value="12345" tooltip="This is a sample tooltip content. It also support html content."> </ins-input-tel>
Code Snippet
<ins-input-tel label="Phone" no-areacode phonenum-placeholder="Phone Number" phonenum-value="12345"> </ins-input-tel>
Code Snippet
<ins-input-tel label="Phone" areacode-placeholder="Area Code" areacode-value="1300" phonenum-placeholder="Phone Number" phonenum-value="12345"> </ins-input-tel>
Code Snippet
<ins-input-tel></ins-input-tel>
Code Snippet
<ins-input-tel has-error error-message="This is a required field"> </ins-input-tel>
Code Snippet
<ins-input-tel id="directSetDataInputtel"> </ins-input-tel> <script> var label_inputtel = 'Telephone', areaCode = '130', phoneNum = '636991'; var phoneField = document.getElementById('directSetDataInputtel'); phoneField.addEventListener('didLoad', function(e){ // Update `label` attribute of the element phoneField.setAttribute('label', label); // Update `countryCode` attribute of the element phoneField.setCountryCode('+1'); // Update `areacodeValue` attribute of the element phoneField.setAttribute('areacode-value', areaCode); // Update `phonenumValue` attribute of the element phoneField.setAttribute('phonenum-value', phoneNum); }); </script>
Code Snippet
<ins-input-tel label="Phone" areacode-value="1300" phonenum-value="12345"> </ins-input-tel>
Code Snippet
<ins-input-tel label="Phone"> </ins-input-tel>
Code Snippet
<ins-input-tel areacode-value="1300"> </ins-input-tel>
Code Snippet
<ins-input-tel Phonenum-value="12345"> </ins-input-tel>
Code Snippet
<ins-input-tel id="insValueChange" label="Phone" areacode-placeholder="Area Code" phonenum-placeholder="Phone Number"> </ins-input-tel> <p id="demo"></p> <p id="demo1"></p> <script> const insInputTelChange = document.getElementById('insValueChange') insInputTelChange.addEventListener('insValueChange', event => { console.log(event); console.log(event.detail.field); console.log(event.detail.value); if (event.detail.field == "area_code") { document.getElementById("demo").innerHTML = event.detail.field + event.detail.value; } else { document.getElementById("demo1").innerHTML = event.detail.field + event.detail.value; } }); </script>
FIELD ATTRIBUTE | TYPE | DEFAULT | OPTIONS | DESCRIPTION |
---|---|---|---|---|
label | string | "" | any | Defines label of input field |
areacode-placeholder | string | "" | any | Defines the short hint that describes the expected value in the area code input field |
areacode-value | string | "" | any | Defines the value of an area code input element |
phonenum-placeholder | string | "" | any | Defines the short hint that describes the expected value in the phone number input field |
phonenum-value | string | "" | any | Defines phone number value |
country-code | string | "" | any | Defines countryCode value |
area-code | string | "" | any | Defines name of area code input field |
phone-number | string | "" | any | Defines name of phone number input field |
error-message | string | "" | any | Defines the error message when input element is wrong |
required | boolean | false | true, false | Specifies that the input field must be filled out before submitting the form |
has-error | boolean | false | true, false | Specifies validation or mandatory input for the input field |
disabled | boolean | false | true, false | Disables input field |
readonly | boolean | false | true, false | Specifies that the input field is read-only |
no-areacode | boolean | false | true, false | Removes the area code field |
tooltip | string | "" | - | Displays a tooltip beside the label. Supports HTML Content |
EVENT | OBJECT | DESCRIPTION |
---|---|---|
insInput | field, value | Returns value when an element gets user areacode or phone number input |
insValueChange | value | Emits the value on change |
METHOD | PARAMETERS | DESCRIPTION |
---|---|---|
getValue | None | Returns the formatted value of the field |
getCountryData | None | Returns the data of the selected country |
setCountryData | countryCode: String | Programmatically set the country code of the field. |
Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.