• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1646
  • Last Modified:

php list and mouse events

I have built a simple menu and the last list item in the menu is shown conditionally using a simple if else php clause.

The problem is that the mouse when I try to insert a mouse event in to my conditional list item it does not work and I receive an error.
Shown bellow is the code I am using.

    <li><a href="#" onclick="MM_showHideLayers('specs','','show')">specs</a></li>
    <li><a href="#" onclick="MM_showHideLayers('text_Insert','','show')">info</a></li>
    <li><a href="#" onclick="MM_showHideLayers('gallery','','show')">images</a></li>
if ($video == 'yes') {
echo'<li><a href="#"onclick="MM_showHideLayers('vid','','show')">vid</a></li>';

Open in new window

1 Solution
Change this: echo'<li><a href="#"onclick="MM_showHideLayers('vid','','show')">vid</a></li>';
echo'<li><a href="#"onclick="MM_showHideLayers(\'vid\',\'\',\'show\')">vid</a></li>';
... or write

if ($video == 'yes') {
<li><a href="#" onclick="MM_showHideLayers('vid','','show')">vid</a></li>

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now