חיפוש בתמיכה

יש להימנע מהונאות תמיכה. לעולם לא נבקש ממך להתקשר או לשלוח הודעת טקסט למספר טלפון או לשתף מידע אישי. נא לדווח על כל פעילות חשודה באמצעות באפשרות ״דיווח על שימוש לרעה״.

מידע נוסף

firefox cache loses the "disabled" attribute on html tags

  • 1 תגובה
  • 1 has this problem
  • 22 views
  • תגובה אחרונה מאת 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