/    Sign up×
Community /Pin to ProfileBookmark

Update TextArea using Javascript

Hi,

I’m developing an AJAX application and a main part is the ability for the content of a TextArea updating on the change of a drop down menu.

If the text were to be placed in a div container it would be:

[CODE]
if(ajaxRequest.readyState == 4)
{
document.getElementById(display).innerHTML=ajaxRequest.responseText;
}
[/CODE]

To have the response text placed in the TextArea I thought I could simply update the value property:

[CODE]
if(ajaxRequest.readyState == 4)
{
document.getElementById(display).value=ajaxRequest.responseText;
}
[/CODE]

But the TextArea doesn’t seem to support the value property.

So, can anybody help me update the content of a TextArea with the responseText of the AJAX call.

Thanks,

Nick

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@KorJun 03.2008 — Should work. Make sure your textarea has an id. can we see the whole code? (HTML included) . Or the relevant part of.
Copy linkTweet thisAlerts:
@uraknaiauthorJun 03.2008 — I think I've figured out what's wrong. I'm using TinyMCE as a RTE and for some reason it's not updating with the content and there doesn't seem to be a solution at present.

Is there another free simple RTE I could use that will update on change of the menu?

Cheers,

Nick
×

Success!

Help @uraknai spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...