[CLOSED] TextField - Maxlength

  1. #1

    [CLOSED] TextField - Maxlength

    Hi, I'm presenting an example of what I need, ok? Well, is this. I have a TextField with MaxLength = 5. When I enter the number -11111 eg I want him to not count the negative sign. You understand? How do I make the symbol of the negative be disregarded in the count?
    Last edited by geoffrey.mcgill; May 18, 2011 at 6:50 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I can suggest the following solution.

    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 runat="server" MaxLength="5" EnableKeyEvents="true">
            <Listeners>
                <KeyDown Handler="var key = e.getKey();
                                  if (key === 109 || key === 189) {
                                      this.setMaxLength(6);
                                  }" />
                <KeyUp Handler="if (this.getRawValue().indexOf('-') === -1) {
                                    this.setMaxLength(5);
                                }" />
            </Listeners>
        </ext:NumberField>
        </form>
    </body>
    </html>

Similar Threads

  1. issue about maxlength of TextField
    By sonnh11 in forum 1.x Help
    Replies: 4
    Last Post: Jan 07, 2013, 6:33 AM
  2. TextField MaxLength not working
    By xtremexploit in forum 2.x Help
    Replies: 1
    Last Post: Jun 18, 2012, 11:28 PM
  3. change textfield maxlength
    By [WP]joju in forum 1.x Help
    Replies: 1
    Last Post: Sep 24, 2009, 4:51 AM
  4. MaxLength validation in TextField & NumericField
    By madhugumma in forum 1.x Help
    Replies: 0
    Last Post: Aug 06, 2009, 4:46 AM

Tags for this Thread

Posting Permissions