Skip Navigation

[Resolved] readonly for one of mt text field

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by opadipeO 1 year, 10 months ago.

Author
Posts
#2532551

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?

#2532687

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>
#2533487

My issue is resolved now. Thank you!