Passer la navigation

[Résolu] readonly for one of mt text field

This support ticket is created Il y a 3 years, 4 months. There's a good chance that you are reading advice that it now obsolete.

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.

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par opadipeO Il y a 3 years, 4 months.

Auteur
Publications
#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

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+01: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!