Sounds more like a javascript question rather than CakePHP...
But anyway... you can add an onClick event to the td, have a boolean value
to check that it wasn't clicked before (so it will update content only after
first click)... Make the td have an ID, and the function that handles the
onClick sets a timeout of 15 seconds to run itself with a parameter (so you
know you are now supposed to update the TD content) and then use innerHTML
to change the value.
Here is an example (haven't even tested this so you may find errors,
programming in my email client doesn't give much for debugging ;):
<script type="text/javascript">
<!--
var bTimeClicked = false;
function updateTdTime(bUpdateContent)
{
if (!bTimeClicked)
{
bTimeClicked = true;
if (bUpdateContent == null)
{
self.setTimeOut('updateTdTime(true);', 15000);
}
else if (bUpdateContent)
{
var oTdTime = document.getElementById('tdTime');
if (oTdTime)
{
oTdTime.innerHTML = 'SOMETHING ELSE HERE';
}
}
}
}
//-->
</script>
<td class="intmain" align="center" width="193" id="tdTime"
onClick="updateTdTime();">Time it</td>
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de xSHAZA
Enviado el: Sábado, 02 de Diciembre de 2006 04:28 a.m.
Para: Cake PHP
Asunto: onClick question?
How can I make it so when I have this line
<td class="intmain" align="center" width="193">Time it</td>
then when I click "Time it!" it will display another string in its
place in 15 seconds
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---