Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Issue: MVC Editor Templates should support HTML5 input types such as tel, url, and email when [DataType] is applied to the property [2]

$
0
0
For example, imagine this model type:
public class MyModel
{
public int ID { get; set; }

[DataType(DataType.Url)]
public string WebSite { get; set; }

[DataType(DataType.EmailAddress)]
public string Email { get; set; }
}

In MVC3 it gets rendered roughly like this (with everything set to type="text):
ID: <input type=”text” name=”ID” value=”123” />
WebSite: <input type=”text” name=”WebSite” value=”http://example.com/path/file.html” />
Email: <input type=”text” name=”Email” value=”eilon@example.com” />

In MVC4 it should render more appropriate "type" attributes:
ID: <input type=”number” name=”ID” value=”123” />
WebSite: <input type=”url” name=”WebSite” value=”http://example.com/path/file.html” />
Email: <input type=”email” name=”Email” value=”eilon@example.com” />

We need to do this automatically for tel, url, email, datetime, date, time, and number.
Comments: Fixed in changeset 68a34436db0c25068b2d437f72ca59ac67239b27

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>