User tests: Successful: Unsuccessful:
Currently Joomla.submitform method do not trigger native 'submit' DOM event, that make a lot problem.
And this pull allow to do this.
Some benefits:
how to test
put this code into index.php in the template:
<script>
jQuery(document).ready(function($){
var form = document.getElementById('item-form');
if(!form){
return;
}
// test native
var method = document.addEventListener ? 'addEventListener' : 'attachEvent',
event = document.addEventListener ? 'submit' : 'onsubmit';
form[method](event, function(){
alert('Well done! Push OK!');
});
// test jquery, any other library
$(form).on('submit', function(){
return confirm('Continue ???');
});
});
</script>go to edit article form, and try save/cancel/apply ...
expected result
after each push on toolbar button you should get 2 popup,
and if on question 'Continue ???' you push "Cancel" form should not be submitted.
actual result
nothing happens
Also this pull require more than 2 simple test,
Need make sure that other forms also works as before,
Need make sure that this work in IE, and other browser that Joomla! promised to support.
I hope this finally solve such problems #6580, #3484, #5914, #6384
| Labels |
Added:
?
|
||
| Title |
|
||||||
| Labels |
Added:
?
|
||||||
| Status | Pending | ⇒ | Ready to Commit |
sorry guys, I did one more update,
because if you have form <form id="adminForm" novalidate> and try submit it Joomla.submitform('task', 'adminForm', true); validation still will be disabled.
my last commit fix it
| Status | Ready to Commit | ⇒ | Pending |
| Category | ⇒ | JavaScript |
| Labels |
Removed:
?
|
||
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-04-04 17:04:58 |
Wow, that was fast!
| Labels |
Added:
?
|
||
| Labels |
Removed:
?
|
||
@test ok
also with code:
And with the last iteration of #6207
Nice one @Fedik Thanks!