Disable BBCode in this post
You've checked that on the post page, I've unchecked it for you
For your question: it's not that simple to answer.
When you click a link from your code php is already set and done. The code is javascript and works client-side, at this stage there's no connection to server (until you perform a new request ...a request for a new document).
Open your browser's source view, what you see there is everything that happens at this moment ...php is not involved anymore.
And that's why I've moved the thread to "client side"
So what you're trying to do has to be done client-side (with javascript/domhtml) or by performing a new request (what you apparently want to avoid)
the best I can provide you right now is an example how to change two elements on one click
Code: Select all
<html>
<head>
<script type="text/javascript">
function switchImage(sSource, sDescription)
{
objImg = document.getElementById("full_image");
objDesc = document.getElementById("imagedesc");
if (objImg==null || objDesc==null)
return false;
objImg.src = sSource;
objImg.alt = sSource;
objDesc.value = sDescription;
return true;
}
</script>
</head>
<body>
<img src="a.png" alt="a.png" id="full_image" />
<br />
<!-- a disabled input field is ugly but easy to handle ;-) -->
<input type="text" disabled="disabled" id="imagedesc" />
<br />
<button onClick="switchImage('a.png', 'image A');">image A</button>
<button onClick="switchImage('b.png', 'image B');">image B</button>
<button onClick="switchImage('c.png', 'image C');">image C</button>
<button onClick="switchImage('d.png', 'image D');">image D</button>
<script type="text/javascript">switchImage('a.png', 'image A');</script>
</body>
</html>