ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,197 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Guys I have question
How can Add Phone Number Charecter Validation
For example.. User writing 8 charecter but ı want minimum 10 charecter and maximum 20 charekter how can add ?
Model
index.cshtml
If you are interested in extending the JavaScript validation, then maybe do it like this:
if( tel1.length < 10 || tel1.length > 20 )
{
. . . show the error . . .
}
Also check the HTML documentation for modern elements like <input type="tel"...>
.
Hello.
On the field Tel1 for exemple add some annondation like this
[StringLength(20, MinimumLength=10)]
public string Tel1 (get; set;)