Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • @slash75

    Participant

    I updated the code with what is below but it still is not working.

    `jQuery(document).ready(function() {
    jQuery(‘#field_29’).blur(function(e) {
    if (validatePhone(‘field_29’)) {
    jQuery(‘#spnPhoneStatus’).html(‘Valid’);
    jQuery(‘#spnPhoneStatus’).css(‘color’, ‘green’);
    }
    else {
    jQuery(‘#spnPhoneStatus’).html(‘Invalid’);
    jQuery(‘#spnPhoneStatus’).css(‘color’, ‘red’);
    }
    });
    });

    function validatePhone(field_29) {
    var a = document.getElementById(field_29).value;
    var filter = /^[0-9-+]+jQuery/;
    if (filter.test(a)) {
    return true;
    }
    else {
    return false;
    }
    }

    @slash75

    Participant

    I tried this as well but it did not work.

    Is there any reason that The Phone Number field type does not validate phone numbers?

    @slash75

    Participant

    I added the following code to the bp-custom.php file but unfortunately it did not work.

    
    <?php
    
    $(document).ready(function() {
        $('#field_29').blur(function(e) {
            if (validatePhone('field_29')) {
                $('#spnPhoneStatus').html('Valid');
                $('#spnPhoneStatus').css('color', 'green');
            }
            else {
                $('#spnPhoneStatus').html('Invalid');
                $('#spnPhoneStatus').css('color', 'red');
            }
        });
    });
    
    function validatePhone(field_29) {
        var a = document.getElementById(field_29).value;
        var filter = /^[0-9-+]+$/;
        if (filter.test(a)) {
            return true;
        }
        else {
            return false;
        }
    }
    
    ?>
    

    @slash75

    Participant

    Thanks for the link. Where would I add this code?

    @slash75

    Participant

    That worked. Thanks!

    @slash75

    Participant

    I looked on the profile edit screen but do not see this anywhere.
    Also, there is nothing on my activity screen.

Viewing 6 replies - 1 through 6 (of 6 total)
Skip to toolbar