Again on my project in creating front end forms, I’ve ran into this issue:`
'html_field_open' => '<div>', // field wrapper open
'html_field_close' => '</div>', // field wrapper close
Those options for the acf_form function are not applying. I tried making the opener “<div class=”rofl”>” and doing a search for it in source, and it isn’t appearing anywhere. I also thought maybe it was just getting the element type, so I tried ul tag and that didn’t work either so I can only assume that it’s not applying.
What would be also awesome, is if you could add another option like the form_attributes but make it ‘field_attributes’ so you can apply your own classes to all the inputs instead of relying on jQuery.
Lastly, I am getting a .live() error with front end.. Looks like its coming from line 205 on /acf-repeater/js/input.js
I am using latest jQuery… I think live was deprecated a while back and that may be causing an issue with latest release?
Thanks Elliot, I appreciate your help.
First of, codoes on using rofl as a way of debugging.. gotta remember that ;9
I can’t help you with most of this but I do think that your jquery error is due to the latest jquery. in the next version of ACF it says on the do to:
JS: Major update to conditional logic JS to allow for repeater sub fields – will also require an update to the repeater field add-on
So I think Elliot will have that fixed by then. In the meantime if it really screws with you it wouldn’t be the end to revert back to 1.8.2 (i think thats the last one). I’ve had to do it myself on some occasions..
Yes, it’s a development site so I’m not worried, just making sure @elliot was aware which I am sure he is.
“rofl” is a good quick search in source, unless of course that is commonly used in your framework 😉
Slightly off-topic, but as I’m continuing to work, what about a ‘html_validation_error_msg’ field as well? Or is there a filter I can use for that? I’d like to make the validation error message a little more friendly since it’s a front-end form.
Thanks for the bug report. I’ll do some testing and get this sorted in the next version.
The latest version of ACF has no reference to the ‘live’ function (unless I have missed one.) – the add-ons are yet to receive a JS update, so that may be the root of the Js issue
Just to re-cap on this thread:
'html_field_open' => '<div>', // field wrapper open 'html_field_close' => '</div>', // field wrapper close
found in the documentation were a mistake. There is unfortunately no way of customizing this at the moment.
I will keep this in mind into the future as I hope to make ACF more front end dev friendly.
As for the .live error. This will be fixed in an upcoming update for the repeater field add-on.
Okay, thanks for the clarification. I figured something wasn’t filtering in. That’s great news on making more options for ACF front end. For now, I am making some cool adjustments via the message field and simply adding wrapping divs for some neat combining with Bootstrap.
Anyhow, RE the validation.. Yes, ACF is validating correctly, I think I phrased this question incorrectly. I would like to change the text for the validation error so its a little more user friendly… So something like “Opps, looks like something is missing” as opposed to the word “invalid.”
Along those lines also, is there a way to place the validation error message next to the submit button? This again is regarding the front end submission.
A couple suggestions that would be awesome regarding validation are:
– the above if not currently possible
– With the “Tabs” auto grouping, that the tab gets a class “acf-group-contains-error” or something if a field within the tab group has a validation error. This would allow styling of that tab to make it more obvious to the user.
– Individual validation messages per field. So if I have a phone number field, i could customize the message for that specfic field to be “Please provide your phone number.” as opposed to a generic “field is required.”
I tried messing around with some jQ to get the above working but was unsuccessful. I am definitely not the type to request something without first trying at least.
Made the simple changes of .live to .on in all the addons, so I’m not worried.
You must be logged in to reply to this topic.
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!
It’s official! These brilliant minds (@tessak22 and @zgordon) are creating an entire course on ACF Blocks! Interested in Gutenberg but enjoy the comfortable recliner that is PHP? This course is for you! Pre-sale on now! 🔥🔥🔥 https://t.co/ifMzctgsN8— Advanced Custom Fields (@wp_acf) September 4, 2019
© 2019 Advanced Custom Fields. Subscribe