# AJAX textarea problem (javascript newbie, alas)

**URL:** <https://www.ruby-forum.com/t/ajax-textarea-problem-javascript-newbie-alas/104497>\
**Category:** Rails\
**Created:** [May 18, 2007, 6:46pm UTC](https://www.ruby-forum.com/t/ajax-textarea-problem-javascript-newbie-alas/104497 "2007-05-18T18:46:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenneth\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/3d9bf3/32.png) [@Kenneth\_D](https://www.ruby-forum.com/u/Kenneth_D)\
**Post date:** [May 18, 2007, 6:46pm UTC](https://www.ruby-forum.com/t/ajax-textarea-problem-javascript-newbie-alas/104497/1 "2007-05-18T18:46:52Z")

</div>

I have a form which contains the following:

\<%= render(:partial=\>‘recipients’) -%\>

The recipients partial:

\<%= @recipients.join("\r\n") -%\>

And the submit button:

updtrecipients rebuilds the @recipients array.

This works fine as long as the textarea is in it’s pristine state,  
i.e., nothing has been typed in it by the user. OTOH, if the  
user has typed or deleted anything in the textarea, it does  
not get updated when the button is clicked. Is there a better  
approach for this? I would like the user to be able to  
manually add or delete from the contents of the textarea  
as well as programmatically insert textarea content.

Thanks much

Ken

–

I use the words you taught me. If they don’t mean anything any more,  
teach me others. Or let me be silent.  
Samuel Beckett (Clov, Endgame)
