[CLOSED] Preventing NumberField from setting values to 0/MinValue/MaxValue

  1. #1

    [CLOSED] Preventing NumberField from setting values to 0/MinValue/MaxValue

    Hi all,

    is it possible to prevent values from being automatically set to MinValue/MaxValue when exceeding the range? I'm using the InvalidClass property to set a colored background if the typed value is empty or too high or too low - that's working perfectly, but I need to save the values as is, even if they are invalid. The NumberField resets <empty> to 0 and too high/low values to valid max/min numbers; if I save and show them again in the dialog, they are different from what the user input originally was. So, is it possible to use the validation without Ext.net changing the values?

    Thank you! Ingo

    <ext:NumberField runat="server" ID="txtField" IDMode="Static" Width="20" MaxLength="1" AllowBlank="false" MinValue="0" MaxValue="3" AllowNegative="false" InvalidClass="axvFieldIndicator" />
    Last edited by Daniil; Feb 13, 2013 at 10:34 AM. Reason: [CLOSED]
  2. #2
    Hello!

    What version of Ext.NET are you using? I've tried with 1.6 and it didn't replace invalid values. Click image for larger version. 

Name:	numberfield.JPG 
Views:	78 
Size:	10.0 KB 
ID:	5601

    However, you can always use custom VTypes: https://examples1.ext.net/#/Form/Val.../Custom_VType/
  3. #3
    We're working with 1.6, right. I should have been more precise: The field doesn't change the value when leaving, I'm even able to copy the value within a change listener and .getValue() into a HiddenField (in order to save the value from the hidden field later in code behind). But then, in code behind, the .Value property returns the automatically corrected value. So now, I'm saving the value from the hidden field, which is a quite bad workaround. ;)
  4. #4
    Hello,

    You can use the NumberField's RawValue property. It contains a raw value from a POST.
  5. #5
    Yes - that's it! :) Thanks a lot, Daniil.

Similar Threads

  1. [CLOSED] NumberField MinValue return null value
    By Aurelio in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 22, 2012, 1:10 PM
  2. GridPanel NumberField Editor MaxValue
    By vincent_van in forum 1.x Help
    Replies: 0
    Last Post: Feb 10, 2011, 7:41 AM
  3. [CLOSED] NumberField MinValue Problem
    By majestic in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 28, 2010, 3:04 PM
  4. [CLOSED] GridPanel NumberField MaxValue
    By Ben in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 17, 2009, 12:22 PM
  5. [CLOSED] TimeField minValue maxValue
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 14, 2009, 6:20 AM

Posting Permissions