Support

Account

Home Forums Front-end Issues html_field_open & .live error

Solving

html_field_open & .live error

  • Hi @elliot,

    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.

  • Hi Synergy..

    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..

  • hi @jonathan,

    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 πŸ˜‰

    Thanks.

    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.

    • Elliot

    • September 3, 2013 at 12:45 pm

    Hi @synergywp

    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

    Thanks
    E

  • Thanks @elliot,

    Yes, definitely coming from line 205 in the repeater addon, input.js file, says Mr. Firebug.

    Any idea on how I can customize the validation error message, aside from tampering with the plugin files?

    • Elliot

    • September 3, 2013 at 2:47 pm

    Hi @synergywp

    customize the validation error message?

    What do you mean by this?

  • Hi @elliot,

    When I submit a form on front end and the validation turns up error, the message is: Validation Failed. One or more fields below are required.

    How would you suggest I alter that?

    • Elliot

    • September 4, 2013 at 2:50 pm

    Hi @synergywp

    Do you have any required fields? Is this an issue with the plugin, or is the plugin rightly validating the fields?

    • Elliot

    • September 24, 2013 at 3:58 pm

    Hi @synergywp

    Just to re-cap on this thread:

    The options:

    
    '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.

    Thanks
    E

  • Hi @elliot,

    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.

    Thanks Elliot.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.