adsense

Wednesday, December 7, 2022

validate input type without the protocol for the url

 We can use jQuery validate to format input URL with a valid URL as shown below


rules: {

    url_field: {

      required: true,

      url: true,

      normalizer: function (value){

                value = value.replace(/^https?:\/\//, '');

                return 'http://' + value;

            }

    }

  }


Cheers

Samitha

No comments:

Post a Comment