Jump to content

run a function by clicking an html button


Marchingknight11

Recommended Posts

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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.