# Javascript add text fields

**URL:** <https://www.ruby-forum.com/t/javascript-add-text-fields/185679>\
**Category:** Rails\
**Created:** [March 24, 2010, 4:00pm UTC](https://www.ruby-forum.com/t/javascript-add-text-fields/185679 "2010-03-24T16:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ESESES](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/f0a364/32.png) [@ESESES](https://www.ruby-forum.com/u/ESESES)\
**Post date:** [March 24, 2010, 4:00pm UTC](https://www.ruby-forum.com/t/javascript-add-text-fields/185679/1 "2010-03-24T16:00:00Z")

</div>

I am trying to add a functionality similar to adding an attachment to  
an email in Gmail.

I have a form to create object1. One field is to add a book  
reference. When you click the link “add book” a popup opens with the  
book form. Clicking the “add” button closes the popup and puts the  
title of the book in a text field associated with the book in  
object1’s form.

Now, I would like to add the functionality that another text field  
will appear with a link saying “add book” to open the popup again.  
How can I do that? I eventually also want to have the possibility of  
deleting the book reference.
