Skip Navigation

[Resolved] Hidden category field values not saving to database

This support ticket is created 6 years, 7 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 25 replies, has 2 voices.

Last updated by Shane 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#883260

I am trying to:
Allow members to contribute to a topic using a form. The form will be on a "parent" page. The user will create a post that should link to the parent page.

Link to a page where the issue can be seen:
hidden link

I expected to see:
Category fields saved in database

Instead, I got:
Input has correct values but is not saving.
<input type="hidden" id="cred_form_13364_2-hidden-2-1526306400" name="category" value="content-experience, marketing-automation-campaign-lead-management" class="wpt-form-hidden form-hidden" data-wpt-id="cred_form_13364_2_cred_form_13364_2-hidden-2-1526306400" data-wpt-name="category">

The categories are dynamic based on the page.

The same is true for the relationship field.
<input type="hidden" id="cred_form_13364_2-hidden-4-1526308025" name="@round-up-contribution.parent" value="" class="wpt-form-hidden form-hidden" data-wpt-id="cred_form_13364_2_cred_form_13364_2-hidden-4-1526308025" data-wpt-name="@round-up-contribution.parent">

Values are available, but not saved to db.

#883558

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Iana,

Thank you for contacting our support forum.

I believe you shouldn't create a hidden field but rather create a normal field and hide that field using CSS.

Or before that you can try adding persist: 1 to the attributes on the generic field

Thanks,
Shane

#885621

Thanks. This worked for category, but not for the relationship field.

I can pass the value of the current page (parent) to the form (child) in an attempt to write to the relationship field, but this does not save as a relationship (or at least doesn't appear to).

I'm using this:
[cred_field field='@round-up-contribution.parent' value='[wpv-post-title output="sanitize"]' class='form-control' output='bootstrap']

on this page: hidden link

Oddly, even when I make a selection (and don't try to pre-pop and hide field), the parent and child are not connected, and I'm unable to select one on the edit screen.

Perhaps I'm just using the wrong value?
hidden link

Any hints or tips would be appreciated.

#889351

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Iana,

For this field I believe you need to specify the post ID.

So you should use [wpv-post-id] to select the parent.

Please let me know if this helps.
Thanks,
Shane

#889363

Hi Shane,
I tried this, but with no luck.
You can see it here:
hidden link

This is the cred field I used.
[cred_field field='@round-up-contribution.parent' value='[wpv-post-id]' class='form-control' output='bootstrap']
I have not hidden it and when I test it, I don't make any selection changes.
Any other hints?

#890464

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2018-05-15 at 2.36.54 PM.png

Hi Iana,

I see that the value is automatically selected, see screenshot

If I understand the issue correctly is that it's not saving the parent value correct?

Please let me know .

Thanks,
Shane

#890471

Hi Shane,
Yes. I mentioned it before that:
"Oddly, even when I make a selection (and don't try to pre-pop and hide field), the parent and child are not connected, and I'm unable to select one on the edit screen."
I can select the field, but it's not saving correctly or is not making the connection between the child and parent.
Thanks,
Lana

#892972

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Iana,

Would you mind if I took a duplicator package from your site to test this locally for you?

Thanks,
Shane

#893053

Yes, thank you. I have backed up the site.

#893054

Here is the page you can test.
hidden link

#897678

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Iana,

There has been a release of Toolset Forms RC 3.

Could you try updating to this version and let me know if the issue still remains.

Thanks,
Shane

#898234

Shane,
I've updated. The form does not work at all now. 🙁

#898242

Ok. I delete the old form and created a new one using the same html/shortcodes. The form submits, but the category and relationship fields aren't passing.

#899353

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Iana,

Could you update types to the latest version of its RC as well and let me know the results.

I want to ensure all grounds are covered before I escalate this ticket.

Thanks,
Shane

#899386

I already did that... Are you referring to something in particular that I've missed?