Skip Navigation

[Resolved] Convert Single Line Custom Field to Select

This support ticket is created 5 years, 6 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 9 replies, has 2 voices.

Last updated by Minesh 5 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1299423
custom_field.png

I'm trying to convert this single field to a select field. I've looked into your documentation and it's not helping in the attached scenario.

#1299439

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you already experience, Toolset will allow you to convert the fields of one type of another field type to only specific field types, the field types to which you will not be able to convert will remain disabled that means you are not allowed to convert the field to that field type due to certain reasons

#1299477

Well in that scenario, I have a CRED form where this field is allowed to be updated by the user. I've defined this field as below.
Is there a way to override how a user interacts with this field within the CRED form?

Current field within CRED form

<div class="col-sm-6">
<label>State</label>
[cred_field field="mepr-address-state" force_type="field" class="form-control" output="bootstrap"]
</div>

#1299529

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Ok but still your requirement is not clear to me. I see you have one field with Toolset form - do you want to convert that field to select field?

#1299555

Well ideally, I would like to covert this field to a select field.. But since I can't do this..
I want to know if in the cred form, for this field, can I display it to the user as a select field with hard coded options even though in the back end, it's a single value field

#1299561

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - you can add a Generic select field to your form where you can define the hardcoded options.

More info:
=> https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/

#1301377
Future Golf Mail - Convert Single Line Custom-2.jpg
Future Golf Mail - Convert Single Line Custom-1.jpg

Please see attached messages as I'm getting an error providing this info by your sucuri firewall on this website.
Please advise how to resolve this,

#1301461

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

There is no code needs to be added when you want to save the generic field content to database.

What if you try to add the following attribute to your generic field.:

"persist": 1,

The field value should be automatically saved then. You do not need to write any code.

#1302559

Hi,
I've removed the additional code as mentioned.

I've updated the generic field with the following attribute and I'm still getting the same error.
I'm happy to provide a login with a link to the modal that I'm trying to edit...?

Cheers

   <div class="form-group">
      <div class="row">
        <div class="col-sm-6">
		<label>State</label>
          [cred_generic_field type='select' field='mepr-address-state']
          {
          "required":1,
          "persist":1,
          "default":[],
          "options":[{"value":"VIC","label":"Victoria"},{"value":"NSW","label":"New South Wales"},{"value":"QLD","label":"Queensland"},{"value":"SA","label":"South Australia"},{"value":"WA","label":"Western Australia"}]
          }
          [/cred_generic_field]
        </div>
        <div class="col-sm-6">
		<label>Postcode</label>
		[cred_field field="mepr-address-zip" force_type="field" class="form-control" output="bootstrap"]
        </div>
      </div>
	</div>
#1302577

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - can you please share problem URL where you added the form and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.