ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

"safecracker_head" and jQuery validation plugin issue

June 20, 2012 1:44pm

Subscribe [1]
  • #1 / Jun 20, 2012 1:44pm

    LightmakerUK

    42 posts

    Hi.

    I’m using the jQuery validation plugin on a Safecracker form. I’m also using the EE Geotagger add-on.

    Unfortunately, the validation plugin doesn’t work as expected in the form - after a few attempts, it will allow the form to be submitted with field validation errors. However, if I include ‘safecracker_head=“no”’ in my Safecracker tag, the validation plugin does it’s job and works as expected.

    Including this is not an option though, as the Geotagger module requires the Safecracker head to work.

    I notice that there are several WC3 HTML validation errors in the output Safecracker head code, and was wondering if something in there could be causing the jQuery validation plugin to choke, or if anyone had come across this issue before?

    Many thanks.

  • #2 / Jun 21, 2012 3:28pm

    Bhashkar Yadav

    727 posts

    Hi LightmakerUK,

    Can you use jQuery.noConflict() with jquery validation.

    and also put the validation script just after safecraker tag ends.

    Hope this would help you.

  • #3 / Jun 25, 2012 6:45am

    LightmakerUK

    42 posts

    Hi Bhashkar.

    Thanks for the reply, but unfortunately this didn’t work - I’m not really sure why it would work though, as jQuery is the only library used - maybe I’m missing something? Also having scripts within the HTML is not really ideal.

    If anyone else has any ideas, that would be great. If EE have any suggestions, they would also be greatly appreciated.

    Thanks.

  • #4 / Jun 25, 2012 8:54am

    LightmakerUK

    42 posts

    I copied the rendered Geotagger Safecracker head code and pasted this in my template - it seems that there is some conflict between this and the validation plugin causing the Validation plugin not to work correctly. So it’s not really an EE issue.

  • #5 / Jun 27, 2012 1:01am

    Bhashkar Yadav

    727 posts

    Hi,

    yes, it’s not an EE issue. just do one thing, put you jquery validation code just after {/exp:safecraker} tag. it can be a trick.


    Best Regards,
    Bhashkar Yadav

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases