Form submit not behaving as expected
I have a form that has a submit button. The action page is action.cfm. Action.cfm executes cfscript to restart a cfusion server instance. While the restart code is working, the problem i have is at the end of the action.cfm when i cflocation back to the initial form page. The problem is that when i click the submitt button a second time it does not work. If i click the submit button a thrid time it does work. The pattern that emerges is that every other click works after the first click.
I have looked at page caching and other things i have found on the net that look as though could be the problem, but what i think this boils down to is that my understanding of the fundamentals is not where it needs to be for form submissions. I have also tired self submitting form, which i had no luck with either. Again, probably my bad but i am open to best practice and ease of use suggestions.
Any help is greatly appreciated. Thanks in advance.
The code below is in a file named restartit.cfm
<cfform name="myform" action="http://123.456.789.123:8301/restart.cfm" method="post">
<cfinput type ="button" onclick="document.myform.submit();" name="fbutton" value="restart">
</cfform>
Here is restart.cfm
<cfscript>
//relevant code here
</cfscript>
<cflocation url="http://123.456.789.123:8301/restartit.cfm" addtoken="no">
recap:
goto restartit.cfm and you will see a button. click the button the restart.cfm is run and cflocation back to restartit.cfm. This time when clicking on the button, it does not restart the server. Click it again, and it will restart the server.
Fyi, this is not restarting the server that it is hosinting the page. It is a different server instance killing a different server.
