ryan8720 wrote:
> Hi everyone,
> 
> I'm new to rails, and I've got my application up and running. Now I'd
> like to add a function that I haven't been able to find information
> on.
> 
> Basically, I start with a form that asks the user to input the number
> of widgets of some type they have.
> 
> For example (____ is a textfield):
> 
> _____ widgets of type ______.
> 
> Then I want to have a link below this that says "Add more widgets."
> This would insert another line between the above and the "Add more
> widgets" link. This would be able to be repeated as many times as the
> user wants to enter widgets of many different types. Also, the new
> lines should appear without refreshing the page.
> 
> Any help is appreciated.  I hope this is the right forum.  I figure
> this will take some AJAX.  I've done something similar before with
> JavaScript, but it just hid/unhid a div.

You don't need Ajax just to add more input fields: there's usually no 
reason to make a server request for something so simple.  It can be done 
completely on the client side -- look at Element.clone() .

> 
> Thanks,
> Ryan

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to