11155
(-- --)
May 27, 2010, 3:04pm
1
Hii
I need to add textbox dynamically when I click "Add" button.
On clicking on button the textboxes are to be displayed one below the
other.
I enter different text in different textboxes, when clicked submit
button all the content in all the textboxes should be saved.
How can I achive this functionality?
Please help. Thank you.
hassan
(Hassan Schroeder)
May 27, 2010, 3:35pm
2
A client-side action like this is done with JavaScript.
A JS library like Prototype or jQuery can be helpful, but you still have
to write the code
hassan
(Hassan Schroeder)
May 27, 2010, 4:20pm
4
Which is still JavaScript, but with a pointless (in this case) round-trip
to the server
It is probably correct that the round trip to the server is pointless,
but not necessarily, we do not know enough about the requirement.
Maybe the text boxes to be added depend on data the user has entered
and in data in the database in some way that would make AJAX more
appropriate.
Colin
hassan
(Hassan Schroeder)
May 27, 2010, 4:40pm
6
Of course that's possible, but if so certainly not apparent in the OP's
description of the task.
11155
(-- --)
May 28, 2010, 5:32am
8
chewmanfoo wrote:
#75 Complex Forms Part 3 - RailsCasts
that might help
Thanks chewmanfoo, this is what the functionality Im looking for.
Thanks all for replying.