Home › Forums › Front-end Issues › Front End Form – Gallery Bug
I set up a front end form and it work 95% flawlessly. The only problem i get is when i click on the “add image” button of the galery field i get this Js error:
Uncaught TypeError: Object #<error> has no method ‘value’
(media-models.min.js)
This is the code of my page.
<?php
acf_form_head();
if( !is_user_logged_in() ){
header("Location:" . home_url());
}
$post_id = NULL;
if( !empty($_POST['recipe_id']) and is_numeric($_POST['recipe_id']) ){
$post_id = $_POST['recipe_id'];
}
$acf_options = array(
'field_groups' => array(5),
'return' => get_permalink(),
'submit_value' => __('Inoltra', 'ricette')
);
if( $post_id ){
$acf_options['post_id'] = $post_id;
}
?>
<?php get_header(); ?>
<div id="edit-recipe" class="content">
<?php
acf_form($acf_options);
?>
</div>
<?php get_footer(); ?>
Also: it is not clear if i can create a new post or edit only is allowed. Sorry for multiple posting
There are tutorials showing how to create a new post however, it looks like your code above is for editing only.
Can you clarify exactly which button is causing the issue? Is it the one inside the popup? Or is it the actual gallery field button?
Is it possible to get a URL to see this JS error for myself, I may be able to spot the issue.
Thanks
E
Hi @mountainthemes
Can I ask what version of the gallery field add-on are you using?
Can you update it?
With such a highly customized website, I’m not sure I am able to help you on this issue.
On a blank install, I can confirm that the gallery field will work, are you able to test this yourself on a fresh install?
I will test it today or tomorrow on a blank website. I hope to find the way.
Solved
It was the “lodash” js library.
Basically the problem was the js enqueue set of scripts.
The topic ‘Front End Form – Gallery Bug’ 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.