Support » Plugin: Advanced Custom Fields: Validated Field » front end forms stop working when plugin is activated

Viewing 15 replies - 1 through 15 (of 27 total)
  • Plugin Author doublesharp

    (@doublesharp)

    I haven’t tested this at all on the front end using acf_form() so my initial guess is that either something isn’t loading because it isn’t is_admin() or that the validation is failing but the CSS selectors to show the errors aren’t working.

    Can you try using the Developer Tools in Chrome on the network tab to see if there is a request made to wp-ajax.php with the field info when you try to edit/post? You could also try setting the constant ACF_VF_DEBUG to true in wp-config.php which will load the non-minified javascript allowing you to set a breakpoint in the input.js file to see where it stops working – or perhaps there is simply a JavaScript error?

    Hi,

    Many thanks for replying.

    I’m sure it’s not a validation problem and I don’t even set the field type to validation field. The problem starts as soon as I turn the plugin on: the submit button for my post/edit forms stops working apart from the default js validation (if I leave the fields empty the default js validation will still work).

    Chrome’s DT don’t capture anything when I click submit and I’ve also got all WP debugging on and no errors popping up.

    But it could be a problem with my setup as I’m using it a custom theme that I’m building and as I’m a noob it is possible that it might be conflicting with some function.

    Anyway if anyone figures it out I would love to hear about it as this plugin would be quite useful for my site.

    Thanks!

    Plugin Author doublesharp

    (@doublesharp)

    I did some testing last night and was able to get the validation to work on the front-end with some modifications, a big one being including the JavaScript on the front-end and not just the admin, so I’m not sure why you would be seeing a conflict on the front-end with this plugin enabled. If the JavaScript is being included, then it would likely be intercepting the submit click and not letting it continue due to differences in the CSS selectors that I am currently using for the admin.

    If you’re interested I can give you a copy of the dev code so you can give it a try, it will require an additional constant ACF_VF_FRONTEND to be defined and set to true since typically you wouldn’t want the javascript included on the front end.

    Hey that would be great, if you could link to the dev code or email it to mickfilipe@hotmail.com I would really appreciate it. I’ll let you know if it works and if not I’ll try to make it work, I’m no php wizard but I’m learning and this will be a good challenge I guess 🙂

    Cheers

    Plugin Author doublesharp

    (@doublesharp)

    Sorry for the delay. I had some dental work done and have been taking painkillers the past few days, so not much programming. There are some factors I didn’t consider when I did the POC even though it “works”, primarily the DOM element ID’s, so the is still a bit more to do. I’ll let you know once it’s ready to demo.

    Thanks!

    Hey,

    Many thanks for looking into this and If there’s anything I can help you with let me know.

    Cheers!

    Plugin Author doublesharp

    (@doublesharp)

    Sorry – now my parents are in town so I haven’t had a chance to finish testing, plus I’m trying to make some of the global settings easier to manage (options page vs constants).

    If you want to give the dev version a try you can download it from here, then add define( 'ACF_VF_FRONTEND', true ); to your wp-config.php. It would be great if you could let me know either way if it works for you or not.

    Thanks!

    Hey, many thanks for sharing the dev version, I’m a bit busy myself at the moment but I’ll give it a try as soon as I can and will report on results.

    Thanks!

    Plugin Author doublesharp

    (@doublesharp)

    If you haven’t downloaded it, I just put an updated version at the same link if you care to give it a try. The global settings have now been moved to a settings page in the Admin under “Custom Fields > Validated Field”. You want to check the box to enable validation on the front end and save.

    Hey sorry I’ve been quite busy lately and didn’t get the chance to test it yet, I will try it tonight and report back.

    Cheers!

    Hey man, you’re the best! Your awesome plugin is now working with my front end forms 🙂

    I found a few minor bugs though:

    1 – the failed validation warning red borders have disappeared for any fields which are not using the ‘validated field’ type from your plugin; And it only works for fields using the ‘validated field’ type if the user has written down something. If the field is empty only the message pops up at the top;

    2 – The custom error messages for your validated fields are not displaying properly. What I see instead is some weird red mark + a red arrow shape (“class = bit” rings a bell?) Even if custom error message is empty I get this arrow shape and red mark.

    3 – If I type something into a validated field type with a custom php function and it doesn’t ‘return true’ (validated) the validation error message appears twice on top:
    “Validation Failed. One or more fields below are required.
    Validation Failed. See errors below.”

    And no custom errors messages show as per point no.2

    I should have some time this week and will try and have a go at fixing these but if you happen to know the cause of any of the issues please let me know.

    Thanks a lot for all your help mate!

    Hi doublesharp. I ran in the same issue as posted by mickfilipe. There’s a stable update planed for the next days?

    Plugin Author doublesharp

    (@doublesharp)

    Soon, but it might be another week. Currently trying to launch the business that this plugin was originally written for (but not using the front-end piece so it’s not blocking) and at the same time clearing brush from some rural land – high tech/low tech diversification.

    Sorry for the holdup, I’m aiming to have a bug free version early next week, but hey, at least it’s free 😛

    J

    Hi, any chances i could get the dev files too? I have the same problem, and I need it for some work with a client. Wouldn’t mind if there’s stuff to change or modify in the files.

    Hello Man, thank’s for this awesome plugin!

    i’ve been found a issue at file validated_field_v4.php, line 740. You use $sub_field[‘read_only’], but the right is $field[‘read_only’].

    Thank’s again!

Viewing 15 replies - 1 through 15 (of 27 total)
  • The topic ‘front end forms stop working when plugin is activated’ is closed to new replies.