0

I would to be able to edit/add an item without having to edit the price every time. Currently i have to always remove ,00 or change the , into a . in or for the price input to validate.

If i change the web.config file

<globalization enableClientBasedCulture="false" culture="en-US" uiCulture="en-US"/>

Then it works. The editable input is displayed with the default value of .00. However i am not in America and will not be using dollars.

My model is

[Required(ErrorMessage="Please add a price.")]
[DataType(DataType.Currency)]
public decimal Price { get; set; }

1 Answers1

0

some useful links from where you may find your solution!

MVC 3 jQuery Validation/globalizing of number/decimal field

http://haacked.com/archive/2010/05/10/globalizing-mvc-validation.aspx/

http://msdn.microsoft.com/en-us/library/gg674880(VS.98).aspx

Community
  • 1
  • 1
Neel
  • 11,625
  • 3
  • 43
  • 61