You are viewing limited content. For full access, please sign in.

Question

Question

Toggle field editable / locked

asked on May 21, 2017

Hi,

I'm implementing in a LF 10.2 with RIO with Forms.

My form has 8 Date fields, they are always populated with a values from the LF workflow. By default, they should be read-only but I have a Radio button with a question "Has the timeline changed?" with Yes and No as responses. If Yes, all 8 Date fields should be editable and mandatory.

Please can you someone share with me how to achieve this?

Thanks in advance,

Adarsh

0 0

Answer

SELECTED ANSWER
replied on May 21, 2017

You can achieve this with custom script, for example (the radio button field has class "timeline" while the date fields have class "date"):

$(document).ready(function(){
  $(".timeline input").change(function(){
    if ($(this).val() == "Yes") {
      $(".date input").attr("readonly", "True");
      $(".date input").each(function(){$.reInitializeDateField($(this))});
    }
    else {
      $(".date input").removeAttr("readonly");
      $(".date input").each(function(){$.reInitializeDateField($(this))});
    }
  });
  $(".timeline input:checked").each(function(){  
    $(this).trigger('change');
  });

})

 

0 0
replied on May 22, 2017

Thank you Rui, that worked perfectly laugh

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.