Marchingknight11 Posted March 11, 2010 Share Posted March 11, 2010 I want to set it up so that clicking the button will allow me to run a javascript function. I currently have the following code: <head> <script type="text/javascript" src="RunTool.js"></script> ... </head> <body> ... <form> <input type="button" id="btn1" onclick="run()" value="Be The GooRoo!"/> </form> ... </body> Can anyone recognize whats wrong? Link to comment https://forums.phpfreaks.com/topic/194920-run-a-function-by-clicking-an-html-button/ Share on other sites More sharing options...
XeNoMoRpH1030 Posted March 11, 2010 Share Posted March 11, 2010 Well, I think you are in the wrong section as it doesn't seem to relate to PHP. Mind posting what's in RunTool.js, at least the run() function? Link to comment https://forums.phpfreaks.com/topic/194920-run-a-function-by-clicking-an-html-button/#findComment-1024843 Share on other sites More sharing options...
Marchingknight11 Posted March 11, 2010 Author Share Posted March 11, 2010 the first line of run() is document.write("you just clicked the button") It's just there so that I know the function has been called. After that line, it goes off and runs various php functionality. The problem I have is when I click the button, the page goes blank. refreshing brings me back to the original button page. Link to comment https://forums.phpfreaks.com/topic/194920-run-a-function-by-clicking-an-html-button/#findComment-1024845 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.