Javascript worked in 3.7.0 but not 3.7.4

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
kwarr
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Fri Mar 28, 2008 2:41 pm

Javascript worked in 3.7.0 but not 3.7.4

Postby kwarr » Sat Aug 12, 2017 2:14 pm

The following code is in the index.php of my template. It displays and hides content. It worked in 3.7.0 (and previously in 2.x) but does not work in 3.7.4.
Any suggestions would be welcome

Code: Select all

<script type="text/javascript">
    function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }

    function show_all() {
       document.getElementById('month1').style.display = 'block';
       document.getElementById('month2').style.display = 'block';
       document.getElementById('month3').style.display = 'block';
}

    function hide_all() {
       document.getElementById('month1').style.display = 'none';
       document.getElementById('month2').style.display = 'none';
       document.getElementById('month3').style.display = 'none';
}
</script>


Then in the article ...

Code: Select all

<p ><a href="#" onclick="show_all ();">view All months</a> -- <a href="#" onclick="hide_all ();">hide All months</a></p>


and then ...

Code: Select all

<table id="month1">
<tbody>
<tr>
etc .....

kwarr
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Fri Mar 28, 2008 2:41 pm

Re: Javascript worked in 3.7.0 but not 3.7.4

Postby kwarr » Sat Aug 12, 2017 3:05 pm

It looks as though the editor has stripped out the onclick command

I need to find a way to prevent that


Return to “Templates for Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 10 guests