I have a small programming problem (php & javascript). On index.php page I'm printing a news (from mysql db) in a table:
CHECKBOX | NEWStitle | NEWStext | NEWSuser | NEWSdate
checkbox1 | News 1 .. | Shall we.. | User0002 | 28.7.09
Above that table I have small icons (images), representing EDIT, DELETE, ARCHIVE, EMAIL and PDF.
I want to achieve following: When user selects one row - with checkbox - (multiple rows won't be supported) and clicks on a icon, I want that javascript finds out which icon was selected, so I can product a custom url (example:index.php?mod=news&command=edit&id=9).
Is there any chance to do that? If, how??
Parrots and Cedric Bertolini, kindly thanks for you answer. jQuery IS valid option, as I have many other effects done with jQuery.
Ok, so far I know how to get checked items along with Id. Now, how to get task icons?
As I have explained, my cms has small icons above the news table, which represents tasks. EDIT, DELETE, ARCHIVE, EMAIL, PDF.
How to write a function for this?
I want to find out which icon was clicked and get newsid (what I already have - thanks to you :)) so I can serve user with desired task.
Thanks again!