I am working on an MVC 3 application. One of the fields in the model is of type double and is defined as follows:
[Required(ErrorMessageResourceName = "ListingItemPriceRequired", ErrorMessageResourceType = typeof(ErrorMessages))] [Display(Name = "DisplayListingItemPrice", ResourceType = typeof(Display))] [Range(1, 500000000, ErrorMessageResourceName = "ListingItemPriceNotWithinRange", ErrorMessageResourceType = typeof(ErrorMessages))] public double Price { get; set; }
However, when I enter the value of a number with some trailing spaces like "342", I get the default message "Field price must be a number."
Even the validation attribute in the Price input field has something like "data-val-number".
thanks
source share