There has to be a better way to do this. What I am trying is not working,
and seems convoluted. Essentially, a controller method is called, and exits
by rendering a partial the purpose of which is to simply clear a textbox in
the view. So I am calling the partial which established the textbox -- but
it doesn't work (i.e. it doesn't clear the textbox). Does anyone know of a
simpler way to do this that might work? Thanks, RVic, partial below:
<input id="channel_channelnote_note" name="channel[channelnote_note]"
size="15" type="text" value="" onKeyUp="txtBox_onChange(this);"
onClick="txtBox_onChange(this);"/>
<div class="auto_complete"
id="channel_channelnote_note_auto_complete"></div>
<script type="text/javascript">
//<![CDATA[
var channel_channelnote_note_auto_completer = new
Ajax.Autocompleter('channel_channelnote_note',
'channel_channelnote_note_auto_complete', '/channelnotes.js',
{method:'get', paramName:'search'})
//]]>
</script>
<%= observe_field 'channel_channelnote_note', :url => {:controller =>
:channels, :action => 'notesboxchange' }, :with => "'channelnotes=' +
value" %>
<script>
var textbox = document.getElementByName('channel[channelnote_note]');
textbox.value="";
</script>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/7a1776d7-75ff-4287-9214-ff3c1294f8da%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.