User tests: Successful: Unsuccessful:
PR #3484 introduced the ability to bind jquery functionality on submit form event. The problem is that this doesn’t fire as expected as observed on #6207.
Instead of submit
jQuery(form).submit();
it should be:
jQuery(form).trigger("submit");
Apply patch
Open /administrator/components/com_content/views/article/tmpl/edit.php
and insert
JFactory::getDocument()->addScriptDeclaration('
jQuery(document).ready(function() {
jQuery("#item-form").bind("submit", function() {
console.log("works");
});
});
');
just before ? > at around line 75
Try to create (save) an article, you should get in browsers log works
OR follow these instructions
Labels |
Added:
?
|
I think in core.js we pass the form object and trigger submit() and somehow things get messed up with a form id "adminForm" which is not always the case, or something like that was the logged stuff on my test! It’s really weird but I think it is down to the form selector and there the code gets confused and never fire any bind functionality. I hope that this comment makes some sense
I think I know reason, problem not in submit() and trigger("submit"),
it just missed in minified version of the core.js file
here you update the minified version and it works now,
so test good, thanks!
betwen, I thought about something like this http://stackoverflow.com/a/18072246/1000711
in theory it should be more generic,it vanilla, it trigger "real" DOM event, and it trigger html5(!!!) validation
another thought, about merging the javascript files, that have minified version,
would be a lot more safe to create the minified version after merge, not before ... because something tell me that GIT cannot merge them good, if was used different tools for this
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-03-26 14:04:35 |
hm, this is very strange, as under the hood
submit()
andtrigger("submit")
the same thing, jQuery source