Expand my Community achievements bar.

SOLVED

How to set readOnly attributes greyed out in input form

Avatar

Level 4

Does anyone know how can I make some fields that are just readOnly in grey colour so that it's extra clear that they cannot be edited?

 

Here can you find an example:

<form _cs="CompanySignatures (example)" created="2017-01-26 12:59:16.000Z" createdBy-id="12345"
entitySchema="xtk:form" img="xtk:form.png" label="CompanySignatures" lastModified="2025-03-11 15:17:58.000Z"
md5="EXAMPLEMD5HASH" modifiedBy-id="67890" name="companySignatures"
namespace="example" xtkschema="xtk:form">
<createdBy _cs="example@example.com (example@example.com)"/>
<container codepage="1252" colcount="2" label="">
<input readOnly="true" xpath="@internalCompanyNaturalKey"/>
<input readOnly="true" xpath="@internalCompanyCode"/>
<input readOnly="true" xpath="@internalCompanyBranchCode"/>
<input readOnly="true" xpath="@internalCompanyOfficialName"/>
<input xpath="@companyName"/>
<input xpath="@officeName"/>
<input xpath="@visitingAddress"/>
<input xpath="@visitingZipCode"/>
<input xpath="@visitingCity"/>
<input xpath="@postAddress"/>
<input xpath="@postZipCode"/>
<input xpath="@postCity"/>
<input xpath="@email"/>
<input xpath="@phone"/>
<input xpath="@fbUrl"/>
<input xpath="@ytUrl"/>
<input xpath="@inUrl"/>
<input xpath="@igUrl"/>
<input xpath="@wwwUrl"/>
<input xpath="@b2b_wwwUrl"/>
<input xpath="@logoUrl"/>
<input xpath="@orgNumber"/>
<input readOnly="true" xpath="@vanligaFragor"/>
<input readOnly="true" xpath="@kundservice"/>
<input readOnly="true" xpath="@senderAddress"/>
<input readOnly="true" xpath="@replyAddress"/>
<input readOnly="true" xpath="@senderName"/>
<input readOnly="true" xpath="@replyText"/>
</container>
</form>

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @A_B_SE ,

Add a container and paste the below,

<container enabledIf="[/ignored/@triggerMessage]=1" type="enabledGroup">
    <input xpath="@lastName"/>
</container>

ParthaSarathy_0-1741718682391.png

 

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @A_B_SE,

 

You can try to add a style attribute inside your xml.

 

Regards, 

Celia

Avatar

Correct answer by
Community Advisor

Hi @A_B_SE ,

Add a container and paste the below,

<container enabledIf="[/ignored/@triggerMessage]=1" type="enabledGroup">
    <input xpath="@lastName"/>
</container>

ParthaSarathy_0-1741718682391.png

 

Avatar

Level 4

Thanks Partha! Is there a way to just make the box grey and keep the label black?

Avatar

Community Advisor

@A_B_SE , by adding enabledIf="[/ignored/@triggerMessage]=1" type="enabledGroup" you can make the field text to grey (which will be different from other fields in input form) as per above screenshot. But to make complete text box as grey, you can try the Celia's comment.