Hi, first I'm not js programmer...but I need a bit of help. There is a textbox vaguely defined like this: <input class="somerandomname" value=""> By typing text or using paste(from clipboard) element value, in the source code, visibly changes from empty one to match entered text. However when I try to use javascript to populate the textbox, although the text do visually appears inside, value is not changed, like in previous case, and the textbox is treated as empty. Is there something I can do to properly fill the box by use of js?
Post the code. I am sure it's something simple, but without the code, it'll be hard to get it working.
What code, I do not have the class code. Both 'Submit' button and textbox seems like simple html code as you see the line above. I use simple getElementsByTagName to fill the textbox. The problem is even though it's visually filled, the button treats it as empty(does nothing) , I can even read the text from textbox to variable and display it with alert, but as long as it is filled by javascript (getElementsByTagName) it gets ignored by the button.
I'm not exactly if this is what you mean, but JS does not automatically update the values of the element variables. Therefore it makes sense to use a framework like vue.js or react.js. (in vue.js you use v-model which automatically updates the value that has been entered in the input field)
I'm back with the same problem...hope here is a lot of patience reserved for me. With help of Developer Tools in chrome I found a function which handles different events(click, keyup, blur, input). The input event seems to be important because it's triggered when typing text or using paste(clipboard) into the textbox and calls yet another function, unlike "getElementsByTagName" which triggers only the selectionchange event. This explains why my text gets ignored.............. but it does not solve the problem. I'd post some code snippets but: - neither of functions or variables have meaningful names, just one or two letters. - rather privately if anyone would be interested
Check onKeyDown and onKeyUp... you should be able to trigger these on every keystroke of the textarea.