View Single Post
Old 05-01-2008, 01:01 PM   #4 (permalink)
freenity
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

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)
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote