Generating onclick from server

Hello,
I generate some HTML based on data saved on the server. The more data, the more HTML. The data includes an icon that when clicked is supposed to toggle a text field between two values. When I move cursor over the icon, it changes to hand but when I click, onclick Javascript is not called. I have removed the code that changes the values and replaced it with a simple alert().

To verify my javascript, I changed the tag on a fixed icon in my document and it seemed to work. For my PHP generated icon, no luck.

Any hints would be appreciated.

Here is the fixed button code that works. I have commented the original tag

[code]

[code]

This is the simplified code that does not work
[php]
echo “<a href=“javascript:void(0)” onclick=“alert(‘You clicked on somecontrol’)”>”;
echo “<img src=“icons/somecontrol.tiff” width=“14” height=“14” >”;
echo “”;
/php]

Thanks in advance for your help.[/code]

Fixed it!
It was not necessary to precede the single quotes with .
I used View Source from my browser and looked at the code I generated from the server.

Sponsor our Newsletter | Privacy Policy | Terms of Service