Copy link to clipboard
Copied
I have a 'clients' page where the info about the particular client comes into a div when that client's logo image is clicked (Ajax).
What I'm wanting to do is change the border property of the clicked image so that it appears selected. Each of the images is assigned an id dynamically ('pic_<?php echo $row_rsClients['client_id']; ?>'), so I can target one image with:
<..... onload="MM_changeProp('pic_<?php echo $row_rsClients['client_id']; ?>','','borderColor','#000','IMG')" />
which works to change that specific logo.
However, I don't know how to switch other ones back to original state when you click on a different logo.
Is there a php expression to target every number OTHER THAN the variable "client_id" ? Then I would be able to turn all other borders off, which I can do manually if the information was static html.
Any suggestions?
Thanks
Mick
Copy link to clipboard
Copied
Is there a php expression to target every number OTHER THAN the variable "client_id" ?
if ($someValue != $client_id) {
// do something
}
Copy link to clipboard
Copied
Thanks David, but how specifically would I apply that in this scenario? (My php knowledge is very basic!)
To say it a different way, I need to tell the javascript that if the image clicked on is pic No. 'client_id' then do operation A, and do operation B to all other images - ie those whose client_ids are a different value than the one clicked.
Copy link to clipboard
Copied
To say it a different way, I need to tell the javascript that if the image clicked on is pic No. 'client_id' then do operation A, and do operation B to all other images - ie those whose client_ids are a different value than the one clicked.
You can't use PHP do to that. You need to use JavaScript.
The principle in JavaScript is the same: use a conditional statement with !=
if (client_id != something) {
// do A
} else {
// do B
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more