[CLOSED] numberfield text

  1. #1

    [CLOSED] numberfield text

    How do i get the textual value from a NumberField in javascript? getValue() returns the rounded numeric value, but i don't want that, i want the literal value the user typed. How to get it?
    Last edited by Daniil; Sep 02, 2010 at 4:07 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I think you will want to use the .getRawValue() function, see

    http://dev.sencha.com/deploy/dev/doc...er=getRawValue

    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    Hello, Pablo Azevedo!

    Please look at the example.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:NumberField ID="NumberField1" runat="server" EnableKeyEvents="true">
            <Listeners>
                <SpecialKey 
                    Handler="if (e.getKey() == Ext.EventObject.ENTER) {Ext.Msg.alert('getRawValue', #{NumberField1}.getRawValue())}" 
                    StopEvent="true"/>
            </Listeners>
        </ext:NumberField>
        </form>
    </body>
    </html>

    Please note that when a NumberField blurs its value is cutted in according to the DecimalPrecision property.
    decimalPrecision : Number
    The maximum precision to display after the decimal separator (defaults to 2)

Similar Threads

  1. Replies: 2
    Last Post: Jul 11, 2012, 5:18 PM
  2. [CLOSED] NumberField zero empty text and value
    By kemalyigit in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 23, 2012, 11:30 AM
  3. Replies: 10
    Last Post: Apr 05, 2010, 1:42 AM
  4. [CLOSED] Text align left for button text
    By macap in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 09, 2009, 10:52 AM
  5. [CLOSED] MultiSelect and text items with comma in Text property
    By tdracz in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 15, 2009, 2:30 PM

Posting Permissions