Read Only Fields - Setting Font Color
Last Post 11-23-2010 02:21 PM by Ryan Bakerink. 4 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
ChuckUser is Offline
river guide
river guide
Posts:157
Avatar

--
11-09-2010 12:58 PM
    I have noticed when I set my question fields to Read Only, in Internet Explorer 8, it sets the Font Color to a grayed out (embossed style) setting.   I thought I could go to the DF style sheet and customize the font color of the Read Only box.

    In that section, here is where I define the style:

    .DynamicForms_DisabledTextBox
    {
    background-color: #D3D3D3;
    font-weight: Normal;
    font-size: 9pt;
    color: #000000;
    font-family: Tahoma, Arial, Helvetica;
    text-decoration: none;
    }

    In I.E, it has no effect.  But in Firefox, I can see the actual color that I set per my style sheet.  Is there a way around this in I.E. 8

    Thoughts?
    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    11-11-2010 10:49 AM
    Posted By Chuck on 11/09/2010 2:58 PM
    I have noticed when I set my question fields to Read Only, in Internet Explorer 8, it sets the Font Color to a grayed out (embossed style) setting.   I thought I could go to the DF style sheet and customize the font color of the Read Only box.

    In that section, here is where I define the style:

    .DynamicForms_DisabledTextBox
    {
    background-color: #D3D3D3;
    font-weight: Normal;
    font-size: 9pt;
    color: #000000;
    font-family: Tahoma, Arial, Helvetica;
    text-decoration: none;
    }

    In I.E, it has no effect.  But in Firefox, I can see the actual color that I set per my style sheet.  Is there a way around this in I.E. 8

    Thoughts?
    It appears that in DF, one of the options that is used in the setup of textbox which is "READ ONLY", it adds another setting to the element.  When I view the source, I see this added disabled="disabled"

    e.g.
    <'input' name="dnn$ctr478$DynamicForms$TBR_GUID2399ecd8-1381-4929-a695-da4a8b34b311L11" type="text" value="0" maxlength="50" id="dnn_ctr478_DynamicForms_TBR_GUID2399ecd8-1381-4929-a695-da4a8b34b311L11" disabled="disabled" class="total_DisabledTextBox" style="width:200px;" />

    This makes the element in I.E. to disable the text box and renders any color properties set using the class css, useless and in I.E. the color looks grayed out. 

    To get around this issue, I created the textbox not using the "READ ONLY" setting.   Then in my INITIAL JAVASCRIPT box, I identify my text boxes and call a function in my JAVASCRIPT FILE.

    e.g
    Initial Javascript:
    var field1 = $(L11_FieldID);
    setReadOnly(field1);

    Javascript File:
    function setReadOnly(passField){
    document.getElementById(passField).setAttribute('readOnly', 'readOnly');
    }

    This way when the form is initially loaded or does a postback, it sets any QUESTION to have a "READ ONLY" attribute.

    NOTE:  There is a bug in this solution.  If in your
    MODULE CONFIGURATION | AJAX/JQUERY INTEGRATION |
    FORM PROCESSING / SUBMISSION AJAX setting other than DISABLED, it will make your QUESTION to lose the "READ ONLY" attribute to the field.  It does not cause the form to do a POSTBACK.  So make sure the setting is set to DISABLED.

    Chad, do you know around this, in regards of the AJAX setting?

    -Chuck
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    11-11-2010 11:00 AM
    Hi Chuck - Thanks for posting your solution and comments...

    Unfortunately I don't really know a way around this right now... Within the VB.NET code only set "ObjField.ReadOnly=True" and don't actually set the the 'Disabled' property at all so its not something we directly control.

    Here is the exact code used:
    If di.IsReadOnly <> 0 Then
    txtOption.Enabled = False
    If di.FieldClass = "" Then
    txtOption.CssClass = "DynamicForms_DisabledTextBox"
    End If

    End If

    -Chad
    ChuckUser is Offline
    river guide
    river guide
    Posts:157
    Avatar

    --
    11-11-2010 11:03 AM
    Posted By Chad Nash on 11/11/2010 1:00 PM
    Hi Chuck - Thanks for posting your solution and comments...

    Unfortunately I don't really know a way around this right now... Within the VB.NET code only set "ObjField.ReadOnly=True" and don't actually set the the 'Disabled' property at all so its not something we directly control.

    Here is the exact code used:
    If di.IsReadOnly <> 0 Then
    txtOption.Enabled = False
    If di.FieldClass = "" Then
    txtOption.CssClass = "DynamicForms_DisabledTextBox"
    End If

    End If

    -Chad

    Thanks Chad for that piece of information. 

    Ryan BakerinkUser is Offline
    river guide
    river guide
    Posts:1900
    Avatar

    --
    11-23-2010 02:21 PM
    Hello Chuck,

    If you end up gathering any questions please let us know so we can be of assistance.

    Thanks,

    Ryan


    ---
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi