Hello,
I want one of my text input to be readonly so I did this
<div class="form-group col-md-6">
<label for="%%FORM_ID%%_label-nam" readonly>[cred_i18n name='label-nam-label']Label Name[/cred_i18n]</label>
[cred_field field='label-nam' force_type='field' class='form-control' output='bootstrap']
</div>
I added readonly to the label tag but it did not work?
Nigel
Supporter
Languages:
English (English )
Spanish (Español )
Timezone:
Europe/London (GMT+00:00)
The readonly attribute needs to be added to the HTML input, not to the label, but the UI doesn't offer a way to add such attributes.
The input is dynamically generated by the cred_field shortcode, and there are some limited options to modify what is output, see the documentation for the shortcode here: https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field
In the Expert mode editor you can add an attribute readonly="true", as in this example from my own site here:
<div class="form-group">
<label for="%%FORM_ID%%_arbitrary-text">[cred_i18n name='arbitrary-text-label']Arbitrary text[/cred_i18n]</label>
[cred_field field='arbitrary-text' placeholder="Enter text" force_type='field' class='form-control' output='bootstrap' readonly="true"]
</div>
My issue is resolved now. Thank you!