Rich Text Field ReadOnly Internet Explorer

rss

Posted by adavento - Dec 29 ’14 at 05:13

Hello,

 

I have been working on a custom form, using Froms Designer, and have encountered a problem.

 

The form is representing a non-conformance and where you have different tabs for different phases, and when you go from one phase to the next, the previous tab (phase) and its fields should be ReadOnly. The fd.field(‘InternalNameCreatedByFD’).readonly(true) does not work, and I have used javascript and JQuery instead to make the fields ReadOnly. That works great for all web-browsers except Internet Explorer. The fields are rich text, and they get editable. It seems that there is some sort of plug-in (rich text editing), or something else that overrides the ReadOnly.

I have tried all the readonly and disable methods with Javascript and JQuery, but it gets overrrided in Internet Explorer.

Have any encountered this problem before?

 

Any help is appreciated.

  • adavento
    Member
    Member for: 8 years 6 months 7 days
    #1 by adavento Dec 30 ’14 at 03:13

    Here is the solution.

    Insert the code into JS-editor:

    if (typeof(RTE_OnFocus) == 'function') {

    var RTE_OnFocusOrig = RTE_OnFocus;

    RTE_OnFocus = function(strBaseElementID) {

    if (!$('#' + strBaseElementID).data('readonly')) {

    RTE_OnFocusOrig(strBaseElementID);

    } else {

    (RTE_GetEditorDocument(strBaseElementID)).body.contentEditable = false;

    }

    }

    }

    Enable/Disable Rich Text Fields with:

    // Disable

    fd.field('Text').control()._el().find('textarea').data('readonly', true);

    // Enable

    fd.field('Text').control()._el().find('textarea').data('readonly', false);

     

    All thanks to Dmitry Kozlov (Forms Designer Team).

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #2 by Dmitry Kozlov Dec 30 ’14 at 07:52

    [#1]: Thanks for posting it here! Just wanted to add formatted code:

    if (typeof(RTE_OnFocus) == 'function') {
         var RTE_OnFocusOrig = RTE_OnFocus;
         RTE_OnFocus = function(strBaseElementID) {
               if (!$('#' + strBaseElementID).data('readonly')) {
                    RTE_OnFocusOrig(strBaseElementID);
               } else {
                    (RTE_GetEditorDocument(strBaseElementID)).body.contentEditable = false;
               }
         }
    }
    
    // Disable
    fd.field('Text').control()._el().find('textarea').data('readonly', true);
    
    // Enable
    fd.field('Text').control()._el().find('textarea').data('readonly', false);
    
    
  • zahappy
    Member
    Member for: 2 years 2 months 7 days
    #3 by zahappy Apr 2 ’21 at 04:50

    ex.:

     

    $.getScript(url, function() happy wheels{

    // here you can use Zurb

    })

  • peter0900
    Member
    Member for: 6 months 29 days
    #4 by peter0900 Mar 29 ’23 at 04:27

    No user input or updates are permitted when the RichTextBox is set to read-only, but automated changes are still possible. The user can, nonetheless, choose text.

    General Car Wash Company Near Me in USA

Displaying 1 to 4 of 4 messages