Here's the situation: I have a large text input box for the URL here: https://asafaweb.com
It is not necessary to adhere to a strict definition of the URL; I allow addresses without a scheme, and the default is HTTP for ease of use. For example, "stackoverflow.com" would be considered a valid URL. But there are also URLs that I don’t want to resolve for various reasons (i.e., they were blacklisted or they are internal ranges of IP addresses).
I want the input type to be “url” and not the default “text”, so users on mobile devices get a keyboard designed for the context of the URL (for example, iOS gives you the “.com” button), The problem is that as soon as I do this, the standard unobtrusive jQuery validation associated with ASP.NET MVC expects a URL with a schema, thereby breaking my contactless URL support.
This is an MVC4 site, and I have an HTML helper:
@Html.TextBoxFor(m => m.ScanUrl, new { type = "url" })
The ScanUrl attribute then has a custom ValidationAttribute attribute that executes all validated requests to make sure the URL can be crawled.
How can I save an existing validation pattern without jQuery validation in the assumption and want to make sure that the url is, well, a strong url?