[CLOSED] Verify if a numberfield is empty in javascript.

  1. #1

    [CLOSED] Verify if a numberfield is empty in javascript.

    Hi,


    I wish to verify if a numberfield is empty in javascript:

     <ext:NumberField ID="txtParametrosQuantidadePrestacoesMaximaGiro" AnchorHorizontal="100%"
                                                                            runat="server" FieldLabel="Máxima Giro" AllowNegative="false" AllowDecimals="false"
                                                                            DecimalPrecision="2" StyleSpec="text-transform:uppercase;"
                                                                            AllowBlank="false" MaxLength="4" Vtype="numberrange" StartNumberField="#{txtParametrosQuantidadePrestacoesMinima}">
                                                                            <Listeners>
                                                                                <Blur Handler="if(this.getValue() != ''){window.alert('test');}" />
                                                                            </Listeners>
                                                                        </ext:NumberField>
    It Works, but if the value in the NumberField is 0 then it don´t show the alert.
    Last edited by geoffrey.mcgill; Oct 01, 2010 at 9:23 PM. Reason: [CLOSED]
  2. #2
    Maybe give the following a try...

    this.getValue() !== ''
    The !== will also perform a type comparison.
    Geoffrey McGill
    Founder

Similar Threads

  1. [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
  2. [CLOSED] NumberField empty value (-1.7976931348623157e+308)
    By caha76 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 25, 2011, 9:55 PM
  3. Replies: 6
    Last Post: Dec 03, 2010, 5:42 PM
  4. Empty NumberField
    By yyyhxm1 in forum 1.x Help
    Replies: 3
    Last Post: Aug 23, 2010, 2:50 AM
  5. [CLOSED] Empty NumberField
    By armadalabs in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 20, 2010, 8:42 AM

Posting Permissions