Version: (using KDE 4.3.2) OS: Linux Installed from: Mandriva RPMs With konqueror, when we click on "show" in forums in the spoiler button, it does nt shows the hide label, it shows always the same: "show". The code usualy is this : <div style="margin:20px; margin-top:5px"><div class="quotetitle"><b>Spoiler:</b> <input type="button" value="Εμφάνιση" style="width:70px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" /></div><div class="quotecontent"><div style="display: none;">{TEXT}</div></div></div>
I see that in other sites without the above code but may be someone else, the show/hide in spoilers is shown correctly in konqueror I test the above code and it has still the problem, i dont know if it is a problem of konqueror or the code is wrong
This is true for webkit based browsers as well. You cannot simply change the value of any input button element using this.value. Perhaps a bug report needs to be opened upstream in webkit (QtWebKit) for this as well.
Actually this works fine in the most recent versions of khtml, v4.7.4 for me ; so the bug is only apparent when using the webkit engine.
Created attachment 66893 [details] more readable test-case
(In reply to comment #3) > Actually this works fine in the most recent versions of khtml, v4.7.4 for me ; > so the bug is only apparent when using the webkit engine. I take this back. Your test case will work fine in both khtml and webkit engines as well so long as you remove this.innerText = ''; from the code. Not only that, it will work correctly in other webkit based browser like the latest version of chromium as well. No clue why setting innerText to empty seems to have such effect on the input element.
Yes you have right, it is ok after removing this.