Forum: Ruby on Rails AJAX textarea problem (javascript newbie, alas)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9e6f139fdf4818d7999288c3f8e1ac4e?d=identicon&s=25 Kenneth Dunlap (Guest)
on 2007-05-18 18:46
(Received via mailing list)
I have a form which contains the following:

<textarea rows=10 cols=50 name='alias[fdrecipients]'
<%= render(:partial=>'recipients') -%>

The recipients partial:

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

And the submit button:

<input name='commit'
       value='Add recipients'
       onClick="new Ajax.Updater('alias_fdrecipients',
return false;">

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



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)
This topic is locked and can not be replied to.