Note that there are some explanatory texts on larger screens.

plurals
  1. POChanging input text value with Javascript doesn't change display
    primarykey
    data
    text
    <p>I'm trying to change the value of a text <code>input</code> field based on user actions. I'm doing it like this:</p> <pre><code>document.getElementById(textFieldID).value = newValue;</code></pre> <p>It isn't quite working -- the original text in the field remains on the screen, unchanged. However, when I submit the form, it behaves as though the value was indeed changed correctly. (And a debug <code>alert</code> confirms that yup, I'm hitting that bit of the code and passing in the right field ID and text value.) Anybody have any insights? Is there something I need to be doing to redraw the <code>input</code> element? <hr /> <strong>Edit:</strong> Per Jeff B's request, and per the fact that this seems to have everybody stumped, here's some relevant bits of code:</p> <pre><code> &lt;script LANGUAGE="JavaScript" TYPE="text/javascript"> function changeText(changeSelector) { var myindex = document.getElementById(changeSelector+"Recent").selectedIndex; var SelValue = document.getElementById(changeSelector+"Recent").options[myindex].value; document.getElementById(changeSelector).value = SelValue; document.getElementById("historicalText").value = SelValue; document.getElementById("historicalTextSelect").value = changeSelector; } &lt;/script> &lt;input onChange="updateScrollingPreview1217(this); return true;" type="text" id="crawlMsg1217" name="crawlMsg1217" size="60" maxlength="1000" value=""> &lt;select id="crawlMsg1217Recent" name="crawlMsg1217Recent" onchange="javascript:changeText('crawlMsg1217');"> [options go here] &lt;/select> </code></pre> <p>And that "onChange" handler isn't what's gumming up the works; I get the same behavior with or without it. <hr> <strong>Edit 2:</strong> It looks like the problem is being caused by "JSpell", a third-party spelling checker our product uses. (I'm told that clients prefer using it to a spellcheck built into the browser; go figure.) It appears to be slightly misconfigured on my test machine, so I'm going to try straightening that out and praying that it makes the problems go away. If it doesn't ... should be interesting. <hr> <strong>Edit 3:</strong> Yup. Fscking JSpell. Just posted a complete answer for the sake of posterity, will accept it tomorrow when I'm allowed. My thanks to everybody who tried to help; +1's all around, wish I could give more.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload