All,
I am trying to use JQuery’s URL Validator plugin.
http://docs.jquery.com/Plugins/Validation/Methods/url
I have a text box that has a URL. I want to write a function which takes the textbox value, uses the jquery’s validator plugin to validate urls and returns true or false.
Something like Ex:
function validateURL(textval)
{
// var valid = get jquery's validate plugin return value
if(valid)
{
return true;
}
return false;
}
I wanted this to be a reusable function..
Thanks
The validate() jQuery is made to validate a form itself I believe, not just an individual field.
I think you would be better off using a regex to validate a single textbox if you are not trying to a do a form validation.
Here’s an example of a SO question that works.
Source: here