For Joomla 3.x don’t use document.id(‘xxx’)

10 years 1 month ago #444 by Dimitris
Joomla 3.x is supporting IE8 and newer. Using this legacy mootools code is useless. For example the following code:
<script type="text/javascript">
    js = jQuery.noConflict();
    js(document).ready(function() {
        
    });
    Joomla.submitbutton = function(task)
    {
        if (task == 'basic.cancel') {
            Joomla.submitform(task, document.getElementById('basic-form'));
        }
        else {
            
            if (task != 'basic.cancel' && document.formvalidator.isValid(document.id('basic-form'))) {
                
                Joomla.submitform(task, document.getElementById('basic-form'));
            }
            else {
                alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')); ?>');
            }
        }
    }
</script>
Can be: 
if (task != 'basic.cancel' && document.formvalidator.isValid(document.getElementById('basic-form'))) {
Without any compromise.

Recently I propose removing these legacy mootools methods in Joomla PR

Thanks Dimitris

Please Log in or Create an account to join the conversation.

10 years 1 month ago #446 by Andres Maeso
Replied by Andres Maeso on topic For Joomla 3.x don’t use document.id(‘xxx’)
Hey there!

Thanks for your feedback, actually it's a good idea, but as you probably know we stick to Joomla Standards, so we can't remove them until they're removed from Joomla Core. But please, do not hesitate to come back to us when they accept the PR :)

Regards,

Andrés.

Andrés Maeso
Customer relations manager at Joomla Component Creator.

This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

9 years 10 months ago #582 by Dimitris
FYI Joomla 3.4 is scheduled for mid February and has those changes. Also There is a JTHML::(behavior.formvalidator); instead of the JTHML::(behavior.formvalidation); which uses only jQuery. 

Please Log in or Create an account to join the conversation.

9 years 10 months ago #583 by Andres Maeso
Replied by Andres Maeso on topic For Joomla 3.x don’t use document.id(‘xxx’)
Thank you Dimitris, duly noted. I'll pass it to our developers.

Andrés Maeso
Customer relations manager at Joomla Component Creator.

This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.