You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Change border-style for editable fields

edited Feb 4, 2020 11:15AM in Visual Builder 6 comments

Content

We have a requirement to make certain fields of type oj-input-text editable on click of a button. The field should have no border-style: none; when it is in readOnly state. On click of the button, the field border should change to border-style: solid;.

Have tried setting a variable using javascript and using that in the style property of the input text but it did not work.

JS code - 

PageModule.prototype.changeStyle = function(editFlag){
var style;

  if(editFlag)
  {
    style =  "border-style: solid;";
  }
  else
  {
    style = "border-style: none;";
  }
  return style;
  
}

Input Text component - 

      <oj-input-text value="{{ $variables.OrderResponse.CustomerPONumber }}" readonly="[[ $variables.EditFlag !== true]]" label-hint="Purchase Order" id="oj-input-text--1944217321-30" :style="[[ $variables.borderStyle ]]">

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!