[CLOSED] Maxlength or other validation in messagebox prompt

  1. #1

    [CLOSED] Maxlength or other validation in messagebox prompt

    Is it possible to restrict the maxlength of textarea in messagebox prompt to X number of characters such that if validation is broken, they can't click OK?
    Last edited by Daniil; Mar 26, 2013 at 4:21 AM. Reason: [CLOSED]
  2. #2
    Hello!

    You can access using the following approach textfield of Msg.prompt.
    <%@ 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></title>
    </head>
    <body>
      
        <form id="form1" runat="server">
        
        <ext:ResourceManager ID="ResourceManager1" runat="server" DebugConsole="Ext" />
        
        <ext:Button runat="server" Text="Click me" Handler="var p = Ext.Msg.prompt('Title', 'Enter value', function(button, text) { console.log('Callback function'); }); p.textField.maxLength = 1;"></ext:Button>
    
        </form>
    </body>
    </html>
    Also, you can do additional validation using callback function: http://docs.sencha.com/ext-js/4-2/#!...-method-prompt

Similar Threads

  1. Replies: 9
    Last Post: Nov 23, 2012, 3:13 AM
  2. [CLOSED] Validation in Multi-line Prompt
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 02, 2012, 11:00 AM
  3. [CLOSED] MessageBox prompt with required field
    By jchau in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 23, 2012, 4:39 PM
  4. [CLOSED] Messagebox prompt set cursor position to end
    By jchau in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 19, 2010, 11:40 PM
  5. Custom Prompt MessageBox
    By EzaBlade in forum 1.x Help
    Replies: 2
    Last Post: Nov 04, 2009, 11:14 AM

Posting Permissions