How to set readOnly attributes greyed out in input form | Community
Skip to main content
New Participant
March 11, 2025
Solved

How to set readOnly attributes greyed out in input form

  • March 11, 2025
  • 2 replies
  • 735 views

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>

Best answer by ParthaSarathy

Hi @a_b_se ,

Add a container and paste the below,

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

 

2 replies

ParthaSarathy
ParthaSarathyAccepted solution
New Participant
March 11, 2025

Hi @a_b_se ,

Add a container and paste the below,

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

 

 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
A_B_SEAuthor
New Participant
March 11, 2025

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

ParthaSarathy
New Participant
March 14, 2025

@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.

 ~  ParthaSarathy S~  Click here to join ADOBE CAMPAIGN USER GROUP for Quarterly In-person | Hybrid | Virtual Meetups
ccg1706
New Participant
March 11, 2025

Hi @a_b_se,

 

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

 

Regards, 

Celia