Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP expression for every number other than selected one

New Here ,
Aug 14, 2009 Aug 14, 2009

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

TOPICS
Server side applications
714
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 16, 2009 Aug 16, 2009

Is there a php expression to target every number OTHER THAN the variable "client_id" ?

if ($someValue != $client_id) {

  // do something

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2009 Aug 16, 2009

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 17, 2009 Aug 17, 2009
LATEST

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

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines