05-01-2008, 01:01 PM
|
#4 (permalink)
|
|
The Acquainted
Join Date: Feb 2008
Posts: 119
Thanks: 17
|
yes but only for javascript:
input type="text" onclick="[javascriptCode]">
input type="text" onclick="alert('test')">
The above will work because it's executed on the client's machine, but the php code is parsed before the page is send to the client (on the server) so it is impossible to know when the user will click it.
However you can make an ajax call:
input type="text" onclick="$.get('page.php')">
And page.php will have a call to you function: <?call();"?>
This will work. (The above code uses jQuery library)
|
|
|
|