enltr xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"http://www.w3.org/1999/xhtml/vocab/////////////////Validate mobile number using .mobilenumber() | BitsyCodehttps://www.bitsycode.com/methods/forms/mobile-numberValidate mobile number using .mobilenumber() | BitsyCode Validate mobile number using .mobilenumber() | BitsyCode html not-front not-logged-in no-sidebars page-node page-node- page-node-23 node-type-page

Validate mobile number using .mobilenumber()

container

.mobilenumber()


Description: Validate most South African mobile numbers.


Example:

<!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>mobilenumber demo</title>
      <script src="http://code.bitsycode.com/bitsycode-latest.min.js"></script>
    </head>
    <body>
        
        <div class="row">
            <b>Mobile Number:</b><input type="text" name="mobile_number" class="mobile_number" value="" />
            <span class="result"></span>
            <br /><br />
            <input type="button" name="submit" id="validate" value="Validate" onclick="validate()" />
        </div>
        
        <script>
            
        function validate(){
            
            var response="";
            var valid = bitsyCode.mobilenumber(bitsyCode(".mobile_number").val());
            
            response = !valid ? "<strong class='error'>&nbsp;&#x2718 <b>Invalid</b></strong>" :
                                "<strong class='success'>&nbsp;&#x2714; <b>Valid</b></strong>";
            bitsyCode(".result").html(response);
        }
            
        </script>
     
    </body>
    </html>

Preview:

Mobile Number:


Share

Developed and built with passion and commitment.
Maintained by the bitsycode team.