javascript - Reload Text In Submit Button When "Back" Button Is Pressed -


i have html form user selects file upload presses "submit" button.

<form action="upload.php" method="post" enctype="multipart/form-data">     select file upload:     <input type="file" name="filetoupload" id="filetoupload"> <br> <br>     <input type="submit" value="upload file" name="submit" onclick="changebuttontext()" id="submit"> </form> 

when "submit" button clicked, text in button changes "submit" "please wait..." , user sent "upload.php" when upload complete.

<script> function changebuttontext() {     document.getelementbyid("submit").value="please wait...";  } </script> 

if user presses "back" button in browser, go form page, text in button still says "please wait...". i've fixed following code in form page.

<body onunload=""> 

i'm wondering if best way revert text in "submit" button "please wait..." "submit" if "back" button pressed? there nothing else on page user lose doing this, thought i'd ask if best way it.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -