본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

the value present in the element getting shifted from one input to another in firefox 20.0.1 if the label was added as innerhtml onload

more options

If the below code was opened in firefox 20.0.1 and type some value in the text box. once after typing the value hit the browser refresh button. the typed value getting shifted from one input elelment to another.

<html>
<head>
<script>
function searchPageLoader(){
document.getElementById('searchareaa').innerHTML='<label ></label>';
}
</script>
</head>
<body onload="searchPageLoader()">

<div id="searchareaa">
 </div>

                        <input type="text" id="pageCount" value="5"/>
                        <input type="text" id="startlimit" value="11"/>
                        <input type="text" id="endlimit" value="5"/>
</body>
</html>

It is happening only in firefox and and only if we do the innerhtml .


http://stackoverflow.com/questions/16548778/firefox-simple-form-element-with-inner-html-bug

If the below code was opened in firefox 20.0.1 and type some value in the text box. once after typing the value hit the browser refresh button. the typed value getting shifted from one input elelment to another. <pre><nowiki><html> <head> <script> function searchPageLoader(){ document.getElementById('searchareaa').innerHTML='<label ></label>'; } </script> </head> <body onload="searchPageLoader()"> <div id="searchareaa"> </div> <input type="text" id="pageCount" value="5"/> <input type="text" id="startlimit" value="11"/> <input type="text" id="endlimit" value="5"/> </body> </html></nowiki></pre> It is happening only in firefox and and only if we do the innerhtml . http://stackoverflow.com/questions/16548778/firefox-simple-form-element-with-inner-html-bug

글쓴이 cor-el 수정일시

모든 댓글 (3)

more options

Would you mind installing Firefox 21 to see whether the problem still exists in today's release?

https://www.mozilla.org/firefox/fx/#desktop

more options

It seems that the missing <label> element causes Firefox to restore the non-default input value to the wrong input. As a "workaround", use <form> tags around your form elements. Then the values do not migrate on reload.

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function searchPageLoader(){
  document.body.style.backgroundColor = "#ffc";
  document.getElementById('searchareaa').innerHTML='<label></label>';
}
</script>
</head>
<body onload="window.setTimeout('searchPageLoader();', 500);">
<form><!-- To replicate the problem, remove this line -->
<div id="searchareaa"></div>
<input type="text" id="pageCount" value="5">
<input type="text" id="startlimit" value="11">
<input type="text" id="endlimit" value="5">
</form>
</body>
</html>

Note: This was in Firefox 20.0.1.

글쓴이 jscher2000 - Support Volunteer 수정일시

more options

After further investigation, you might need to assign a name attribute to each form element for Firefox to associate the attributes with the correct fields. See: Random disabled Firefox 23.0.1 - mozillaZine Forums.