APEX Supplied HTML Editor (fckeditor) - Limit number of characters

Hi
Has anyone found a way of limiting the number of characters allowed in the HTML Editor that is supplied with APEX (3.1/fckeditor)
I have had a look at the fckeditor web page and found a couple of plugins but I fear that this approach will require me to manually implement fckeditor, and not use the inbuilt one.
I would also prefer to not do this with an application process as the user can overflow the editor and get the HTTP-400 Value param too long error.
Regards
Matt

Dribble!
does this help? Is their anyway to limit the character count on a textarea with html editor

Similar Messages

  • HTML Editor (FCKEditor) broken in Safari (APEX 3.0)?

    Hi folks,
    When using Safari (3.1.1), FCKEditor does not load for me on page items of type HTML Editor). (It's fine using IE and FF). Safari reports:
    Value undefined (result of expression func) is not object.
    .../i/javascript/htmldb_html_elements.js (line 484)Searching the forum I found this reference:
    AJAX result length > 32000
    In his post there, Dan identifies what may be the problem:
    "correct way to handle this is by using the FCKeditor_OnComplete function instead of an onload call. The function takes one parameter, the FCK Editor instance on the page, which in ApEx seems to have been made 'oFCKeditor';"
    ... but I'm still short of a fix.
    Since FCKEditor is now bundled into APEX, I'd hope that APEX would successfully invoke it on all major browsers.
    Does anybody (Apex team?) know a fix?
    Has this been fixed at 3.1?
    Thanks
    john

    Hello,
    Has this been fixed at 3.1?Yes
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • To limit number of characters in a text field...

    I did a little research. My goal is to limit the number of characters in the textfield by 50.
    If the results of my research are correct, I have to create a JFormattedTextField, then use a MaskFormatter with a mask of 50 asteriks. Is that correct? Any other suggestions?
    Thanks in advance.

    I've got a problem using a JFormattedTextField.
    Each time the the text field gains focus, the caret does no move to the end of the text. It appears at the start of it. plus, any text i typed will overwrite the character already typed in, as if you've pressed the INSERT button during typing in a text editor.
    What caused that and how do I resolve it?
    Thanks a lot for the help ;)

  • How do I limit number of characters in a JTextField?(different from others)

    Hi,
    I know this question has been posted several times on this forum, but my question is actually a different one. So please read.
    I have the following code that puts two JTextFields in a JFrame. I want to limit the number of characters in the first JTextField to three characters. What's different about my question from other solutions provided, is that I don't want to be able to type more than three characters in the JTextField, and then not be able to get out of JTextField unless I have three or less characters. What I do want, is to have maximum of three characters, not be able to type the fourth, and have access to the other JTextField at all times.
    I have tried the following solution of setting an InputVerifier to my JTextField, but it hasn't worked, since I can still type the fourth character.
    Looking forward to your help!
    Thanks.
    import java.awt.Dimension;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import javax.swing.InputVerifier;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class TextFieldVerifier {
         public TextFieldVerifier()
              JFrame frame = new JFrame("My TextVerifier");
              JPanel panel = new JPanel();
              JLabel firstTextFieldLabel = new JLabel("First: ");
              JLabel secondTextFieldLabel = new JLabel("Second: ");
              final JTextField myTextField = new JTextField();
              myTextField.setPreferredSize(new Dimension(100,20));
              myTextField.setInputVerifier(new InputVerifier()
                   public boolean verify(JComponent input) {
                        if(myTextField.getText().length()<=3)
                             return true;
                        else
                            return false;     
              myTextField.addKeyListener(new KeyAdapter()
                   public void keyTyped(KeyEvent e)
                        if(!myTextField.getInputVerifier().verify(myTextField))
                             myTextField.setText(myTextField.getText().substring(0, myTextField.getText().length()-1));
              JTextField secondTextField = new JTextField();
              secondTextField.setPreferredSize(new Dimension(100,20));
              panel.add(firstTextFieldLabel);
              panel.add(myTextField);
              panel.add(secondTextFieldLabel);
              panel.add(secondTextField);
              frame.getContentPane().add(panel);
              frame.setSize(new Dimension(200,100));
              frame.setVisible(true);
         public static void main (String [] args)
              TextFieldVerifier v = new TextFieldVerifier();
    }

    Thanks, JayDS! Your suggestion worked. And I've come up with the following code with help of your suggestion. However, I'm not happy with the fact that I see empty spaces in my JFormattedTextField when I don't have anything entered in it, or when my textfield has focus and I click it again. Also, I'd like the text alignment to always stay on the right, even if I have less than 3 digits.
    Could you please help me out with that?
    Thanks!
    import java.awt.Dimension;
    import java.text.ParseException;
    import javax.swing.JFormattedTextField;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.text.MaskFormatter;
    public class TextFieldVerifier {
         public TextFieldVerifier()
              JFrame frame = new JFrame("My TextVerifier");
              JPanel panel = new JPanel();
              JLabel firstTextFieldLabel = new JLabel("First: ");
              JLabel secondTextFieldLabel = new JLabel("Second: ");
              try{
                   VariableLengthMaskFormatter formatter = new VariableLengthMaskFormatter("###");
                   final JFormattedTextField myTextField = new JFormattedTextField(formatter);
                   myTextField.setHorizontalAlignment(JTextField.RIGHT);
                   myTextField.setPreferredSize(new Dimension(100,20));
                   panel.add(firstTextFieldLabel);
                   panel.add(myTextField);
              } catch (ParseException ex) {
                   ex.printStackTrace();
              JTextField secondTextField = new JTextField();
              secondTextField.setPreferredSize(new Dimension(100,20));
              panel.add(secondTextFieldLabel);
              panel.add(secondTextField);
              frame.getContentPane().add(panel);
              frame.setSize(new Dimension(200,100));
              frame.setVisible(true);
         protected MaskFormatter createFormatter(String s) {
             MaskFormatter formatter = null;
             try {
                  formatter = new MaskFormatter(s);
             } catch (java.text.ParseException exc) {
                 System.err.println("formatter is bad: " + exc.getMessage());
                 System.exit(-1);
             return formatter;
         public static void main (String [] args)
              TextFieldVerifier v = new TextFieldVerifier();
    }Edited by: programmer_girl on Mar 10, 2008 11:10 PM

  • Limit number of characters in a text cell

    Hi Numbers Community,
    Is there a way to put a cap on the number of characters that can be written into a cell with Data Format set as Text?
    Thanks for your help!

    There doesn't seem to be a way to keep you from going over a limit on the number of characters in a cell but you can use Conditional Highlighting to alert you when you do go over the limit. This, for example, sets the background color of cell B9 to red if there are more than four characters in cell A9:
    The formula in B9:  =LEN(A9)
    SG

  • Limit number of characters in a JTextField

    Now I know that this question has been asked very often but the answers that have been given do not always work. According to other posts you can either use a KeyListener or a DocumentListener. The problem with the code that I have seen using a KeyListener is that you can't use the backspace key when the limit is reached. I am using a JTextField and all the answers dealing with Documents use a JTextArea and I can't figure out how to get it to work with JTextField. I don't understand why the Swing package just didn't come out with a method or cunstructor for these components to limit the number of characters. It would simplify things a lot. I need a JTextField to allow only 25 characters and allow backspaces. Thanks

    Here is the code that I am using. It seems to be working somewhat. The only problem now is that when you type the 26th key that new key overwrites what is in the 25th position. Is this the correct way of doing it and if so how do I get it to quit adding in the key that was just pressed?
    user_box.addKeyListener(new KeyAdapter() {
        public void keyPressed(KeyEvent e) {
         if((user_box.getText().length() > 24)&&(e.getKeyCode() != KeyEvent.VK_BACK_SPACE)) {
    //     System.out.println(e.getKeyCode());
         e.consume();
         try {
              user_box.setText(user_box.getText(0,24));
         }catch(Exception ex) {}
         Toolkit kit = Toolkit.getDefaultToolkit();
         kit.beep(); //system beep
    });

  • Limit number of characters in a textbox

    I'm trying to limit the number of characters a user can enter into the text box on a form.  
    Any help is appreciated.

    Thanks.
    I found this code, but am having problems using it (specifically the keyascii as integer part):
    Sub LimitKeyPress(ctl As Control, iMaxLen As Integer, KeyAscii As Integer)
    On Error GoTo Err_LimitKeyPress
        ' Purpose:  Limit the text in an unbound text box/combo.
        ' Usage:    In the control's KeyPress event procedure:
        '             Call LimitKeyPress(Me.MyTextBox, 12, KeyAscii)
        ' Note:     Requires LimitChange() in control's Change event also.
        If Len(ctl.Text) - ctl.SelLength >= iMaxLen Then
            If KeyAscii <> vbKeyBack Then
                KeyAscii = 0
                Beep
            End If
        End If
    Exit_LimitKeyPress:
        Exit Sub
    Err_LimitKeyPress:
        Call LogError(Err.Number, Err.Description, "LimitKeyPress()")
        Resume Exit_LimitKeyPress
    End Sub
    Sub LimitChange(ctl As Control, iMaxLen As Integer)
    On Error GoTo Err_LimitChange
        ' Purpose:  Limit the text in an unbound text box/combo.
        ' Usage:    In the control's Change event procedure:
        '               Call LimitChange(Me.MyTextBox, 12)
        ' Note:     Requires LimitKeyPress() in control's KeyPress event also.
        If Len(ctl.Text) > iMaxLen Then
            MsgBox "Truncated to " & iMaxLen & " characters.", vbExclamation, "Too long"
            ctl.Text = Left(ctl.Text, iMaxLen)
            ctl.SelStart = iMaxLen
        End If
    Exit_LimitChange:
        Exit Sub
    Err_LimitChange:
        Call LogError(Err.Number, Err.Description, "LimitChange()")
        Resume Exit_LimitChange
    End Sub

  • How to limit number of characters in a JTextField?

    Hi,
    I am new to java and I would like to create a JTextField which only allows the users to enter no more than 32 characters. How do I do that? I am looking for a "set..." function but cannot find it.
    Thanks for any hint.
    Richard

    Unfortunately there's no setXXX() method that will do it. You'll need to create a new document class that will accomplish what you want. See attached sample working code.
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class Limit {
    public static void main(String args[]) {
      new LimitFrame();
    class LimitFrame extends JFrame {
    JTextField jtf = new JTextField(10);
    LimitFrame() {
      super();
      jtf.setDocument(new LimitDocument(5));
      /* Components should be added to the container's content pane */
      Container cp = getContentPane();
      cp.add(BorderLayout.NORTH,jtf);
      /* Add the window listener */
      addWindowListener(new WindowAdapter() {
       public void windowClosing(WindowEvent evt) {
        dispose(); System.exit(0);}});
      /* Size the frame */
      pack();
      /* Center the frame */
      Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
      Rectangle frameDim = getBounds();
      setLocation((screenDim.width - frameDim.width) / 2,(screenDim.height - frameDim.height) / 2);
      /* Show the frame */
      setVisible(true);
    class LimitDocument extends PlainDocument
    int limit;
    public LimitDocument(int limit)
      this.limit = limit;
    public void insertString(int offset, String s, AttributeSet a) throws BadLocationException
      if (offset + s.length() <= limit)
       super.insertString(offset,s,a);
      else
       Toolkit.getDefaultToolkit().beep();
    }

  • How can I use javascript in a Text Area with HTML editor??

    My question is... how can I use javascript in Text Area with HTML editor??
    I can use javascript functions that change the content of Text Areas but i can´t if i try in text area with html editor....
    I need to limit number of characters in a text area with html editor and i can´t.
    could anybody help me please?

    I have been experiencing similar problems with the HTML Editor and have managed to find an answer that should start to answer some of my questions. The Apex HTML Editor Standard is actually an HTML editor called FCKeditor. The FCKeditor has a Javascript API that can be found at http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API. Unfortuately this doesn't seem to give the whole answer and I found more at http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:49607.
    I needed to get the text entered within my html editor standard (e.g. P1_MYTEXT) and use it within my javascript function. I did this by using the following script
    <script language="JavaScript" type="text/javascript">
    function showtext(){
    var oEditor = FCKeditorAPI.GetInstance('P1_MYTEXT');
    var editortext = escape(oEditor.GetXHTML(oEditor.FormatOutput));
    alert(editortext);
    </script>
    Hope this helps.
    Matthew

  • APEX - Spelling check and textarea with html editor

    I have an item on the form defines as textarea with html editor. I also need to be able to do spelling check, but the "textarea html editor" only has font features and no spelling check. Is there away to define an item to have both spelling check and font features in APEX? Any response is greately appreciated.
    Thank you,
    MT

    MT,
    No, this is not a supported region type in APEX 3.2.
    You can take a look at jQuery and the number of rich text editors available for it: http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors
    Hope this helps.
    Thanks,
    - Scott -
    http://spendolini.blogspot.com
    http://www.sumneva.com

  • Printing the data in "Textarea with HTML editor" item in APEX as pdf

    Hello,
    I have a requirement which goes like this.
    The user enters data in the HTML editor in APEX. All the tools available in the HTML toolbar will be used (eg. bulleted points, tables etc.). This data is stored in a single cell in the database. This data needs to be generated as a pdf for printing. We have Apache FOP installed as well.
    When I try to create a report region with this data and export it as pdf, the html tags are not considered. For eg. the table in the HTML editor doesn't appear as a table in the pdf, only the text appears.
    Let me know if such a transformation is possible. Also, can any other tool perform this??
    Note: The data in the HTML editor may not be in a fixed template. Whatever is entered there has to be converted.
    Thanks in advance !!

    The strip HTML attribute is set to "No" already. If you understood clearly, I need to convert the entire data in a HTML editor item to pdf. The data is stored in a single cell as HTML tags in the database. The data may inturn contain HTML tables as well. These HTML tables are not captured in the pdf, only the text within the tables are displayed.

  • APEX - Textarea with HTML Editor.

    All,
    I am working with Application Express Version 2.2.1.00.04
    I have the following problem:
    I have an item "Textarea with HTML Editor" which I am inserting
    information CLOB in a table.
    This data is consulted by a Region Report of APEX which has a Link that
    will be a popup. Inside the report, I use wwv_flow_utilities.URLENCODE
    (here the column is a CLOB) where it gives me the error "ORA-06502:
    PL/SQL: numeric or value error: character string buffer too small".
    I started to investigate which might be the problem and saw that the
    item "Textarea with HTML Editor" usually inserts special characters.
    I show an example of the special character that inserts and which is the
    error.
    SELECT wwv_flow_utilities.URLENCODE(' ')
    FROM dual;
    This character, which is like a space in target, is bringing problems to
    be able to execute the report.
    A provisional solution to solve this problem is to put a REPLACE into
    the Query.
    Has anyone this problem.???? Do you know why this character can be
    inserted??????
    Thx..

    Thanks Dimitri!
    I'm trying to find this place in the application but I don't have enough privileges. Here, we are working with Application Express 2.2.1 and we have to upgrade to 3.1.1.
    In order to improve the behaviour of HTML Editor Standard, I think we should integrate FCK to our application, do you know about any step by step explanation to achieve this? Because I was searching this information in the forums, but I can't find anything. Please, any information you can share with me will be very helpful
    Thanks again!

  • Add image/object in HTML Editor Standard item (apex 3.2)

    Hi,
    I'm using the HTML editor standard item from Apex3.2.
    I want the possibility to add an image/object in the editor, but I don't see that option on the HTML editor standard item.
    How do I activate this option? Can someone help me out please?
    I've found something on:
    http://www.inside-oracle-apex.com/enable-add-picture-for-html-editor/#high_1
    Is this the only & easiest solution?
    Thanks,
    Sunenny
    Edited by: Sunenny on Feb 2, 2010 4:32 AM
    Edited by: Sunenny on Feb 2, 2010 4:33 AM

    Sunenny,
    Yes, it would take something like that. Another option, although not any easier really, it to use the latest CKEditor.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • How to create an HTML editor on Apex with the buttons for editing?

    Hi,
    I would like to have an online editor similar to the one I am using to post this thread with a bold, itallic and links button.
    I see there are HTML editor items, however it doesn't have the bold, font buttons when I create the page?
    Below are from the HELP section.
    HTML Editor Standard - Provides more editing functionality, such as font, format and color, than HTML Editor Minimal.
    Text Area with HTML Editor - Provides basic text formatting controls. Note that these controls may not work in all Web browsers.
    Thanks.
    Edited by: Samantha on Oct 21, 2011 2:12 PM

    Hi,
    Thanks. I went to the item area and did not see it after selecting 'Text area'
    Only these items which do not have the cool editing features.
    Textarea
    Textarea (auto-height)
    Textarea with Character Counter
    Textarea with Character Counter & Spellcheck
    Textarea with Spell Checker
    HTML Editor Minimal
    HTML Editor Standard
    Textarea with HTML Editor (deprecated)

  • APEX - html editor minimal

    I have form items declared as html editor minimal on clob columns. When I copy & paste the text from word document into the form or type in the text, my session froze up. I have to kill it to get out. Does anyone have the same problem with html editor minimal? How can it be fixed?
    Thank you so much,
    MT

    Never mind, I found the problem.
    Thank you,
    MT

Maybe you are looking for