frontend does not save field
Support › MB Frontend Submission › frontend does not save fieldResolved
- This topic has 5 replies, 2 voices, and was last updated 2 years, 7 months ago by
Peter.
-
AuthorPosts
-
March 12, 2023 at 2:07 AM #40962
Karthikeyan Ramnath
ParticipantHi there, I have a custom post type to represent a dog (for a dog shelter website). I use front end submission to create/edit dogs.
The edit for shortcode looks like this
[mb_frontend_form id="intake_fields,dog_fields,dog_attrs_fields,fee_fields" post_id='current' post_type='dogs' edit='true']The dog_fields field group has a field called dog_name. As shown in the video, when I create a dog entry the name is not getting saved. This used to work earlier so I'm not sure if something has changed. Can you help me understand where things are failing
https://www.berrycast.com/conversations/2dee3630-de27-584b-9445-b870df86f56c
March 12, 2023 at 3:04 PM #40970Peter
ModeratorHello there,
Can you please share the PHP code generated from those field groups on your site? Please use this tool to share the code https://pastebin.com/
You can also try to change the field ID todog_name1and see if it helps. Refer to the documentation to get PHP code https://docs.metabox.io/extensions/meta-box-builder/#getting-php-codeMarch 13, 2023 at 1:42 AM #40978Karthikeyan Ramnath
ParticipantSure thing. You can find the php code here https://pastebin.com/SvZPNyx1
Also note that fields not saving is not unique to the dog_name field. There is another field for description that too does not save etc. A dog has multiple field groups as shown in the edit shortcode above
Cheers,
KarthikMarch 13, 2023 at 10:36 PM #40987Peter
ModeratorHello,
As I can see in the field settings, the field value will not be saved to the database because
save_fieldis set tofalse. Please read more on the documentation https://docs.metabox.io/field-settings/[ 'name' => __( 'Dog Name', 'your-text-domain' ), 'id' => $prefix . 'dog_name', 'type' => 'text', 'required' => true, 'save_field' => false, // here ],In the builder, please enable the option
Save field valuein the tab Advanced, screenshot https://monosnap.com/file/Kzg6AMQGJOFtcT5HfciPbFQGrWk8UkMarch 14, 2023 at 12:14 AM #40992Karthikeyan Ramnath
ParticipantThanks hopefully this helps fix it for now.
But, did this change in a recent update? All fields have that setting unchecked and this should have never worked if it was this way.
March 14, 2023 at 6:31 PM #41006Peter
ModeratorHello,
I'm not sure what happens on your site, this setting does not affect by updating to the new version. But glad to see it works. Let me know if you have any questions.
-
AuthorPosts
- You must be logged in to reply to this topic.