hi.
can someone help me in how to get the value of textbox and display on textarea?
example: i type anything in textbox then after i lost the focus on textbox
it will display on textarea..
is this possible?
thanks in advance...
hi.
can someone help me in how to get the value of textbox and display on textarea?
example: i type anything in textbox then after i lost the focus on textbox
it will display on textarea..
is this possible?
thanks in advance...
For : pointed you in the right direction. Below are a couple of safe, practical ways to move the textbox value into a textarea and notes on which event to pick so the behavior matches what you expect.
Example — copy when the value actually changed (good for “on losing focus, if text changed” behavior):
<input id="src" type="text">
<textarea id="dst"></textarea>
<script>
document.getElementById('src').addEventListener('change', function (e) {
document.getElementById('dst').value = e.target.value.trim();
});
</script> Example — live copy while typing (updates immediately):
document.getElementById('src').addEventListener('input', function (e) {
document.getElementById('dst').value = e.target.value;
}); Notes and troubleshooting:
change event when you want an update only after the user finishes editing and leaves the field. Use input for instant feedback while typing. See the MDN docs for change and input for details (, input event).value is the right property for both text inputs and textareas (HTMLInputElement.value, HTMLTextAreaElement.value).dst.value += (dst.value ? '\n' : '') + val;.</body>). For very old browsers that lack addEventListener, use a feature-detection fallback.These snippets should cover the common needs for copying a textbox value into a textarea; pick the event that matches the interaction you want.
Jump to Post— adam.adamski.96155 43It's possible using Javascript.
Add the onblur event to the text box and attach it to a function that replicates the textbox value in the textarea.
It's possible using Javascript.
Add the onblur event to the text box and attach it to a function that replicates the textbox value in the textarea.
ok thanks this what i looking for..
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.