Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Cancel Buttons not working - TypeError: form.find

Cancel Buttons not working - TypeError: form.find 01 Mar 2013 03:49 #6879

  • organicwebs
  • organicwebs's Avatar
  • Offline
  • Premium Member
  • Chris
  • Posts: 133
  • Thank you received: 21
  • Karma: 4
For those in the same boat...

If you are using the latest version of JQuery, you will find that the Cancel buttons will stop working. This is because of depreciated code in /administrator/components/com_mycomponent/js/jquery.validationEngine.js

It produces the JS error...
TypeError: form.find(...).not(...).die is not a function
The die() method was removed in jQuery 1.9. See jquery.com/upgrade-guide/1.9/#die-removed

Using an older version of jQuery will get you by (version 1.8 )

Or, for an alternative fix, on line 97 and 98 change
form.find("["+options.validateAttribute+"*=validate]").not("[type=checkbox]").die(options.validationEventTrigger, methods._onFieldEvent);
form.find("["+options.validateAttribute+"*=validate][type=checkbox]").die("click", methods._onFieldEvent);

with
form.find("["+options.validateAttribute+"*=validate]").not("[type=checkbox]").off(options.validationEventTrigger, methods._onFieldEvent);
form.find("["+options.validateAttribute+"*=validate][type=checkbox]").off("click", methods._onFieldEvent);
Also, line 101, change
form.die("submit", methods.onAjaxFormComplete);
with
form.off("submit", methods.onAjaxFormComplete);
Admittedly - I don't really understand this code as well as I should - so hopefully I haven't busted something else with this change! Reply back if you know better...

Same sort of issue as
www.j-cook.pro/forum/19-new-tickets/6758...ve-is-not-a-function

and
www.j-cook.pro/forum/18-closed-tickets/6...button-does-not-work
Just call me Chris :)
Last Edit: 01 Mar 2013 03:56 by organicwebs.
The administrator has disabled public write access.
The following user(s) said Thank You: admin, twev, VeCrea, JoomGuy

Re: Cancel Buttons not working - TypeError: form.find 01 Mar 2013 14:40 #6883

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
All looks OK to me!

Thanks for sharing @bottomupwebs! Karma++
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.
The following user(s) said Thank You: organicwebs

Re: Cancel Buttons not working - TypeError: form.find 18 May 2013 19:39 #7206

  • Ferm
  • Ferm's Avatar
  • Offline
  • Junior Member
  • Posts: 39
  • Thank you received: 6
  • Karma: 2
Thanks for the tip bottomupwebs, it really helped!

In Joomla 2.5, this solves the issue with the cancel button. Using your fixes, I got the cancel buttons to work with JQuery 1.9. I also changed line 28 of /administrator/components/com_mycomponent/js/jquery.validationEngine.js

from

$(".formError").live("click", function() {

to

jQuery(document).on("click",".formerror",function() {

with this change, the validation engine seems to work with jQuery 1.9. Without it, the application runs, but there is no validation.

E
The administrator has disabled public write access.
The following user(s) said Thank You: admin, organicwebs

Re: Cancel Buttons not working - TypeError: form.find 05 Aug 2013 22:04 #10693

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: organicwebs
Time to create page: 0.066 seconds

Get Started