JavaScript
--
Questions
--
Followers
Top Experts
Disable submit button script not resetting on page back in Mozilla Firefox
Why is the following script working ok in AOL browser IE and Netscape but not firefox? Â The following code:
<SCRIPT language=JAVASCRIPT type=TEXT/JAVASCRIPT>
function submitonce()
{
var myform = document.form1;
if (document.all||document.ge tElementBy Id) {
for (i=0;i<myform.length;i++) {
var tempobj=myform.elements[i]
if(tempobj.type.toLowerCas e()=="subm it"||tempo bj.type.to LowerCase( )=="reset" )
tempobj.disabled=true
}
}
else
return false
}
//-->
</SCRIPT>
Causes the submit button on a form to be greyed out. Â If the user clicks back in IE, etc the buttton is clickable again but in Mozilla the button is still grey after the back operation. Â Your thoughts?
-D-
<SCRIPT language=JAVASCRIPT type=TEXT/JAVASCRIPT>
function submitonce()
{
var myform = document.form1;
if (document.all||document.ge
for (i=0;i<myform.length;i++) {
var tempobj=myform.elements[i]
if(tempobj.type.toLowerCas
tempobj.disabled=true
}
}
else
return false
}
//-->
</SCRIPT>
Causes the submit button on a form to be greyed out. Â If the user clicks back in IE, etc the buttton is clickable again but in Mozilla the button is still grey after the back operation. Â Your thoughts?
-D-
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
you can write a similar script to enable them and trigger that from body onload.
That should work for firefox certainly.
-r-
That should work for firefox certainly.
-r-
<html>
<script language="JavaScript1.2">
function mSubmit()
{
      var elmObj=document.getElement ById("mSub it");
      elmObj.disabled=true;
}
</script>
<body>
<input type="Submit" id="mSubit" name="Submit" onclick="javascript:mSubmi t()">
</body>
</html>
Try the above...
<script language="JavaScript1.2">
function mSubmit()
{
      var elmObj=document.getElement
      elmObj.disabled=true;
}
</script>
<body>
<input type="Submit" id="mSubit" name="Submit" onclick="javascript:mSubmi
</body>
</html>
Try the above...
It seems that this still is not reenabling the button if you javascript:back() 8(






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
JavaScript
--
Questions
--
Followers
Top Experts
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.