0

I'm using jQuery Validation Plugin v1.14.0

I know that we can check the form's field like:

  $( "#myform" ).validate({
    rules: {
      field: {
        required: true,
        url: true
      }
    }
  });

Is there a way to check string variable by this plugin and get true or false something like:

var url = 'http://example.com'

var isValidUrl = url.checkUrl() //

whitesiroi
  • 2,725
  • 4
  • 30
  • 64
  • 1
    [AddMethod](http://stackoverflow.com/questions/241145/jquery-validate-plugin-how-to-create-a-simple-custom-rule) – BenG Jan 20 '16 at 08:55
  • 1
    Please review the documentation: [you can attach `.valid()` to the form or an individual field to trigger a test and get a boolean](http://jqueryvalidation.org/valid) – Sparky Jan 20 '16 at 16:06
  • Thank you for your comments. – whitesiroi Jan 21 '16 at 03:19

0 Answers0