Help - Search - Members - Calendar
Full Version: Calling Two Functions From A Button
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > JavaScript
The Seventh Hokage
PROBLEM:

html code for a button

CODE
<button onclick="return addNode('Combo Hit')">Taijutsu Strike </button></br>


there is javascript thrown in there. return addNode()

i need to call a second function for instance.
CODE

<?php
function hit()
{
x-=10
echo x;
}

?>


QUESTION:

i've tried several ways of putting the php function in along side the javascript.

is there anyway to do this? i ask because i would have to totally rewrite my php functions into javascript and there are several pages of them :|

SP_
There isn't a way to invoke a php function with the onClick modifier. You could instead use AJAX, where this would be a perfect time to use it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.