Forums

Forums / Bugs & Issues / Cannot change CSSClass of CRM fields

Cannot change CSSClass of CRM fields

Thread is closed for posting
4 posts, 1 answered
  1. quanganh
    quanganh avatar
    33 posts
    Registered:
    16 Jun 2016
    27 Jul 2016
    Link to this post
    Hello all,

    I cannot change the CSSClass of CRM fields in advance setting. It's not saving.
    Is it possible to add new css class for CRM widget in form ?

    Many thanks,
    Quang Anh
  2. Kasun
    Kasun avatar
    13 posts
    Registered:
    21 May 2015
    29 Jul 2016 in reply to quanganh
    Link to this post
    Hi Quang Anh,

    If you can give me more details of what are you trying to achieve by adding a CSS class to the widget, Ill be able to direct you in the right direction. 

    Thank you 
    Kasun
  3. quanganh
    quanganh avatar
    33 posts
    Registered:
    16 Jun 2016
    01 Aug 2016 in reply to Kasun
    Link to this post
    Hi Kasun,

    I try to set CSS class to the widget to apply a special style for them. Ideally, I style the <input> control which is required have red boder. 

    Do you have any idea to do this ?

    Many thanks,
    Quang Anh
  4. Missing user
    Missing user avatar
    Answered
    17 Aug 2016 in reply to quanganh
    Link to this post
    Hi Quang,

    I have forwarded the required script to apply respective css class to Julien. The details are as following for your reference too. 

    Step1: Place a Javascript widget on your form
    Step2: Paste the following code in it

    function RequiredCheck(){

      $('.txtRequired').each(function(){
    var elementStyle = $(this).attr('style');
    if(elementStyle =='display: inline;')
    {
    $(this).closest('.sfFieldWrp').css('border','1px solid red');
      $(this).closest('.sfFieldWrp').css('border','1px solid red');
    }
    });
    }

    Step3: Select the option under widget to place it “Before the closing body tag”

    Step4: Press edit on Submit button, Press Advanced, Find the tag name “OnClientClick”, and type the function name as RequiredCheck();
4 posts, 1 answered