On 12/9/05, naroor rathish
<hi_naroor-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:>
> Hi all ,
> I was trying the AJAX example given by Curt hibbs
> (http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html) .In the
> example it was putting a list item in the list .I tried adding a new
> text box (input tag ) . I was successfull in adding the text boxes into
> the table when the button was clicked .But I am in doubt on how can I
> capture the contents of the text boxes
Hi,
use the form_remote_tag''s :update parameter to indicate what DOM
element to
update and
and use its :url to decide what to call on ur server. I cant remember the
exact syntax but it goes like this ..like a regular form except that the
form_remote uses Ajax.Updater to send the serialized form data.
the ''submit'' method in your controller should update your
database
<%form_remote_tag :update => ''someid'' , :url =>
{:controller => ''form''
,:action =>''submit'' } %>
<% text_field "id" "Enter Text" %>
<%submit "submit" %>
<%end_form_tag>
Read the docs..its pretty well explain there.
http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html
Vivek
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails