Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Learn More

firefox cache loses the "disabled" attribute on html tags

  • 1 отговор
  • 1 има този проблем
  • 22 изгледи
  • Последен отговор от cor-el

more options

If you load a form with a submit button set to "disabled", and then some javascript removes the "disabled" attribute, if you ctrl-r refresh the page the disabled attribute is missing from the refreshed page.

Here is a minimal repro case. Load the page, note the button is grayed out, when asked "remove disabled attribute?" click "ok", then reload the page, and *don't* remove the disabled attribute. The button should be disabled, but isn't.

<html> 
<head>
	<script type="text/javascript">

	function removeDisabledAttribute(){
		if (confirm("remove disabled attribute?")){
			document.testform.searchbutton.disabled = false;
		}
	}
	</script>
</head>

<body onLoad="removeDisabledAttribute();">

	<form name="testform">
		<input type="text">
		<button type="submit" disabled="disabled" name="searchbutton">Search</button>
	</form>

	<br>
	<a href="http://www.google.com">go to google and come back</a>

</body>
</html>
If you load a form with a submit button set to "disabled", and then some javascript removes the "disabled" attribute, if you ctrl-r refresh the page the disabled attribute is missing from the refreshed page. Here is a minimal repro case. Load the page, note the button is grayed out, when asked "remove disabled attribute?" click "ok", then reload the page, and *don't* remove the disabled attribute. The button should be disabled, but isn't. <br /> <pre><nowiki><html> <head> <script type="text/javascript"> function removeDisabledAttribute(){ if (confirm("remove disabled attribute?")){ document.testform.searchbutton.disabled = false; } } </script> </head> <body onLoad="removeDisabledAttribute();"> <form name="testform"> <input type="text"> <button type="submit" disabled="disabled" name="searchbutton">Search</button> </form> <br> <a href="http://www.google.com">go to google and come back</a> </body> </html></nowiki></pre>

Променено на от cor-el

Всички отговори (1)

more options

A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.

See http://forums.mozillazine.org/viewforum.php?f=25