Hello
I'm trying to create in any language possible (Javascript I think).. the follow:
A textarea that receives the data of a textbox when it loses the focus.
Can anyone help?
Thanks!
Printable View
Hello
I'm trying to create in any language possible (Javascript I think).. the follow:
A textarea that receives the data of a textbox when it loses the focus.
Can anyone help?
Thanks!
When the textbox loses focus, or when the textarea does?
hi!!
This should do it..
<textarea name="textarea"></textarea>
<input type="text" onBlur="entertext();" name="txtTheText">
<script>
function entertext()
{
textarea.value = txtTheText.value
}
</script>
Indeed!! This is it! But instead of deleting the data that is already in the textarea.. I need it to be added to the data that I enter in the textbox. And.. by the way.. the data are numbers with two decimal places and aligned to the right.Quote:
Originally posted by meteor
<textarea name="textarea"></textarea>
<input type="text" onBlur="entertext();" name="txtTheText">
<script>
function entertext()
{
textarea.value = txtTheText.value
}
</script>
And.. of course.. thank you for your help!
That should work.Quote:
<textarea name="textarea"></textarea>
<input type="text" onBlur="entertext();" name="txtTheText">
<script>
function entertext()
{
num1 = parseFloat(textarea.value);
num2 = parseFloat(txtTheText.value);
textarea.value = num1 + num2;
}
</script>