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

Question

Question

radio button, other value update

asked on August 28, 2017 Show version history

I have a table with a radio button #q126 (Relationship) that needs to be populated from lookup data.  The problem is with the Other value, I cannot get the field to be enabled, not ready-only and have the value from ECRELATION (#q384) added:

 

Here is my code:

Help would be appreciated.

0 0

Replies

replied on August 29, 2017 Show version history

If you want everything else in that section to remain read-only except for the single line field, try using the following function. I created it to dynamically change the read only state of a form element.

function setReadOnly(e,t) {
  if(t){
    // Set input element to read-only
    e.attr({'readonly': 'readonly', 'backend-readonly': 'True'});
  } else {
    // Remove readonly from input element
    e.removeAttr('readonly backend-readonly disabled');
  }
}

just pass the form element and a true/false value. For example,

setReadOnly($('#Field1 input[type="text"]'),false);

 

Also, after setting a value with javascript I tend to trigger the change event for good measure since it seems to be necessary for rules and such to trigger. For example, $('field).val('test).change();

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.