Change ReadOnly ViewValue text to Bold

  • In GRID-EDIT mode, I’d like the READONLY myField1.ViewValue text to be bold
  • In PHPMaker myField1 is set to READONLY
  • In ROW_RENDERED I tried:
    $this->myField1->EditAttrs[“class”] = “text-black text-bold”;
  • also tried:
    $this->myField1->ViewAttrs[“class”] = “text-black text-bold”;

but no bold just normal text.

  • Firefox Inspect:
<span class="text-black text-bold">
    <input type="text" readonly="" class="form-control-plaintext" value="300">
</span>

*** NOTE: In LIST mode everything works correctly by changing ViewAttrs

You may inspect HTML element in your browser and check why your CSS styles is not effective.

When I comment out my Row_Rendered code, it becomes:

<span>
    <input type="text" readonly="" class="form-control-plaintext" value="300">
</span>

Which means my code logic is working to add the class=“text-black text-bold”.In my case, the correct way would be to override and add class to I could manually edit the generated files or edit the template. Maybe do a normal text, input text check and then add class or override class

  • If Normal Text Then add 300
  • If INPUT Text Then add

Have you tried Custom Edit Tag?

CUSTOM EDIT TAG > … > CODE:Not working.

There is no need to use server event at all, you may simply add CSS under HTML → Styles → User, e.g.

.form-control-plaintext[readonly] {
    font-weight: bold;
}

I put it in Row_Rendered server event because the text-color will change based on the condition.
If value > 500 then change text to redNew Discovery:in Row_Rendered:
$this->myField1->EditAttrs[“class”] = “text-black text-bold”;Doesn’t affect anything not the outer or the inner
my theory is that because it is READONLY, so no attributes can be added to classon the other hand in Row_Rendered:
$this->myField1->ViewAttrs[“class”] = “text-black text-bold”;Changing ViewAttrs Affects both ListView and Grid-Edit mode outer

ListView is bold correct
Grid-Edit viewmode is still plaintext because it uses so even if outer form-control-plaintext is used instead.SOLUTION
Use HTML → Styles → User and add text-black text-bold to form-control-plaintext, and ignore conditional changing font color , until the class in <input type=“text” readonly=“” class-“form-control-plaintext” value=“600”> can be modified through code.