|
Posted by tg-php on 12/09/05 21:10
As Jochem mentioned, you can use the 'onclick' event to trigger some JS when a user clicks on something. I wanted to add that you may be able to use the 'innerHTML' property to get the HTML contained within the area clicked too.
It sounds like you're saying that the user clicks on a table and that gets loaded into a javascript text editor to edit the table HTML?
If so, try something like this:
<script>
function loadIntoJSEditor(id) {
sendHTMLtoJSEditor(document.getElementById(id).innerHTML);
}
</script>
<span id="ClickableArea1" onClick="loadIntoJSEditor(this.id)">
<table>
<tr><td>someoisjaosjf</td></tr>
<tr><td>someoisjaosjf</td></tr>
<tr><td>someoisjaosjf</td></tr>
</table>
</span>
You can test it by changing "sendHTMLtoJSEditor" to "alert" so it shows in a popup window.
Just make sure all your <span>s or <div>s or whatever you choose to encapsulate the clickable areas in all have unique ID's.
-TG
= = = Original message = = =
Hi,
I am trying to create a Content Management System where users can click on
various parts of a page and the content is displayed in a JavaScript text
editor. For each tag I intend to wrap a link (<a href>) around it. This
works fine for <p> tags but I cant put a link around a <table> tag because
it isnt allowed in HTML. My idea to get around this is make an image from
everything between the table tags with php so I can make it link to another
page, is this possible?
Thanks for your advice
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
Navigation:
[Reply to this message]
|