Skip Navigation

[Resolved] Remove fields from prefilled form using Toolset Forms shortcode

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 7 replies, has 1 voice.

Last updated by jefM 4 weeks, 1 day ago.

Assisted by: Minesh.

Author
Posts
#2842850

Hi,

I created a front-end form using Toolset Forms. I prefill this form with content from the previous entry using the 'post="x"' in the shortcode. Like so: [cred_form form="x" post="x"].

This works, but since some information will certainly be different I would like to prevent certain custom fields from prefilling if you will. How would I be able to achieve this?

Would this be achievable using the Forms API hooks?

Thanks in advance,
Niek

#2843170

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As I understand - do you have Toolset post edit form or add form?

Can you please share problem URL and admin access details and tell me for what fields you want to display/change or you do not want to appy the default value?

*** 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.

#2843344

Minesh
Supporter

Languages: English (English )

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

Thank you for sharing admin access details but when I try to login using the admin access details you shared, I get the following error message:

Error: The username Toolset is not registered on this site. If you are unsure of your username, try your email address instead.

Can you please send me working admin access details.

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

#2843381

Minesh
Supporter

Languages: English (English )

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

I've switched your form mode to Expert mode:
=> hidden link

And added the following code to display your desired field ""wpcf-inschrijving-gewenste-oppervlakte":

[cred_generic_field type='textfield' field='wpcf-inschrijving-gewenste-oppervlakte']{
            "default":"",
            "persist": 1
        }[/cred_generic_field]

You can use the above method for textfield (singlel-line) fields. If you have any other field type like checkboxes etc.. then we may hve to follow bit different method in order to save the checkboxes field selected option values.

#2843383

Hi Minesh,

Great, that seemed to have done the trick! I actually had to change "default':''' to "default:" " (add a blank space), otherwise it kept the original value.

Could you please advice for the dropdown and select too, because I will actually need those.

Thanks again.
Niek

#2843572

Minesh
Supporter

Languages: English (English )

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

The same way you can add the CRED generic field and try to add select dropdown and configure the options.

For exammple:

          [cred_generic_field type='select' field='wpcf-your-field-slug']
{
"required":0,
"default":[],
"options":[{"value":"One","label":"One"},{"value":"Two","label":"Two"}]
}
[/cred_generic_field]

Where:
- make sure to add the field name with "wpcf-" prefix and configure the options same as you have with your custom select field you added to custom field group.

#2844261
form-translate-wpml.png
form-frond-end.png
form-code.png

Hi Minesh

I tried this for the 'VAT' dropdown select to test this, on the same form, and this works. BUT how do I manage this with WPML? There's seems to be 2 issues:

1: I can only translate one of the 2 labels (Two).
2. If I translate the label, it doesn't appear on the front-end.

See images attached to illustrate.

#2844366

Minesh
Supporter

Languages: English (English )

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

Well - To translate generic field select we will have to take different approach.

You should translate your original field from the Types - as shown with the following article at bottom of the page:
- https://toolset.com/2015/08/how-to-develop-a-multilingual-real-estate-site-with-wordpress-and-no-php/

Have you checked the following Doc:
- https://toolset.com/course-lesson/translating-views-content-templates-archives-and-forms/

#2844699

That makes sense.

Thank you!