# Validation of form fields

**URL:** <https://www.ruby-forum.com/t/validation-of-form-fields/106616>\
**Category:** Rails\
**Created:** [June 12, 2007, 2:29pm UTC](https://www.ruby-forum.com/t/validation-of-form-fields/106616 "2007-06-12T14:29:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![athi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dfb087/32.png) [@athi](https://www.ruby-forum.com/u/athi)\
**Post date:** [June 12, 2007, 2:29pm UTC](https://www.ruby-forum.com/t/validation-of-form-fields/106616/1 "2007-06-12T14:29:33Z")

</div>

Hi,  
I have a form that contains two fields :  
Actor - text field  
Movie - text field. On clicking Add another movie link, I am  
displaying another text field for entering another movie using AJAX.  
So on clicking submit , i am doing validations for the form fields. If  
there is an error in the form fields, the text fields we have added  
using AJAX, disappears. Is there any to solve this problem ?

Also what name should I give to the added text field for Movie ? In  
movies table the name of the field is moviename.  
Can we give like \<%= text\_field ‘movie’,‘moviename’ %\>.  
But we have to save all the movie names entered into the movies table  
with actor\_id as the foreign key. How should we name the movie text  
field in this case?

Can anybody help me out in this?
