Home › Forums › Add-ons › Repeater Field › Repeater Field not working in fornt-end acf form
Hi There,
I have created some field groups and displayed it as form in front-end of my site to create the user meta data. Everything works like charm except for the repeater fields. A Field group containing the repeater fields has been created and it works fine on the back-end but doesnot work in front-end. The Add Row and other functions in the repeater fields are not working.
Is there any way to make the Repeater fields work in front-end similar to the backend??
I have been trying to get some help but could not found the solution.
Please help.
The most likely cause of this is another plugin or some other javascript causing a conflict. Have you tried disabling other plugins on the site?
Thanks John for the reply but it was not the exact solution that I needed.
Any way I solved the problem.
Please Close this ticket. I solved it using ACF Front End Plugin and some acf hooks.
Thanks
Glad you got it solved. If you figure out what you did you should post a new comment. It may help others in the future.
~JH
Sure,
I installed a plugin called ACF Front End Plugin, which displayed the repeater field in fine way and also Added new row while clicking the Add Row Button and then to save the fields I used the pre_save_post and save_post hooks.
//first in functions.php
add_filter(‘acf/pre_save_post’ , ‘my_pre_save_post’ );
function my_pre_save_post( $post_id ) {
global $post;
$current_id = get_current_user_id();
$post_id = ‘user_’ . $current_id;
do_action(‘acf/save_post’, $post_id);
}
and then in template file to save it
if(isset($_POST)){
// $post_id to save against
$current_id = get_current_user_id();
$postID = ‘user_’ . $current_id;
// update the fields as user meta
do_action(‘acf/save_post’, $postID);
}
Hope it helps for others too.
Thanks,
The topic ‘Repeater Field not working in fornt-end acf form’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.