Skip Navigation

[Resolved] CREDFORM selection box

This support ticket is created 4 years, 10 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 4 replies, has 2 voices.

Last updated by felixP-3 4 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1499971

Tell us what you are trying to do?

I have a credform field :
[cred_field field='@government-address.parent' required="true" class='form-control select-government' output='bootstrap' select_text='--- not set ---']

This field lists all the governments that can be associated with an address. This field allows me to associate multiple addresses with a single government (This works fine).

I would like to make the selection of the government using code.

For example if one of the governments in the list was "New York", I would like to write code that selects "New York" instead of having to manually select it (for example: SelectItem("New York)).

Is this possible?

#1501395

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Actually - the select field value will be stored as a numeric value and you would like to target using the option text.

You need to add custom JS/jQuery code in order to achieve such a custom requirements. Please check the following example that might help you to implement it:
=> hidden link

#1502409

Thanks for your help. The solution you gave me works for a selection box that I create.

The selection box toolset provides for selecting a related post is more complex.

For example, when I click on that selection box, it begins searching for the posts. It appears the selection box is initially empty until you click on it.

When I use the method you provided me to get the number of options, the count is ZERO.

But when you click on it, it says "searching..." and then the drop down shows the post titles and the values of each entry is the post id.

This is the CRED FIELD : [cred_field field='@government-address.parent' required="true" class='form-control select-government' output='bootstrap' select_text='--- not set ---']

Is there a way to auto fill the selection box? Otherwise, I will need to make my own control.

Thanks

#1502955

Minesh
Supporter

Languages: English (English )

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

Can you please share the problem URL where I can see the field as well as 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.

#1513961

My issue is resolved now. Thank you!