Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to validate the phone number in form field xml

how to check the phone number field in joomla

<field
        name="mobileno"
        type="tel"
        description="mobileno"
        label="Mobileno"
        pattern="[0-9]{10}" 
        required="true"
        size="30"  
    />
like image 622
Mathesh Raj Avatar asked Oct 19 '22 04:10

Mathesh Raj


1 Answers

There are some ready made validations available including telephone validation. You just have to add validate="tel" in your xml file.

<field
        name="mobileno"
        type="tel"
        description="mobileno"
        label="Mobileno"
        validate="tel" 
        required="true"
        size="30"  
    />

Reference: Validation rules

like image 196
emmanuel Avatar answered Oct 21 '22 22:10

emmanuel