# Accessing form array when errors display

**URL:** <https://www.ruby-forum.com/t/accessing-form-array-when-errors-display/74824>\
**Category:** Rails\
**Created:** [February 28, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/accessing-form-array-when-errors-display/74824 "2006-02-28T17:19:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuntinS\_SethSKATE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/77aa72/32.png) [@BuntinS\_SethSKATE](https://www.ruby-forum.com/u/BuntinS_SethSKATE)\
**Post date:** [February 28, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/accessing-form-array-when-errors-display/74824/1 "2006-02-28T17:19:41Z")

</div>

Is there a way to access (from JavaScript preferably) the form array of  
the information sent when errors are display? I want to be able to find  
out what values were selected on the form before errors.

Seth B.

Web Resources Coordinator

Kentucky Academy of Technology Education

Murray State University

On March 1, 2006, Murray State University will begin moving all of its  
telephone numbers in the 762- exchange to an 809- exchange.

My new number will be (270) 809-4207

---

<div class="post-metadata">

**Author:** ![BuntinS\_SethSKATE](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/77aa72/32.png) [@BuntinS\_SethSKATE](https://www.ruby-forum.com/u/BuntinS_SethSKATE)\
**Post date:** [February 28, 2006, 8:43pm UTC](https://www.ruby-forum.com/t/accessing-form-array-when-errors-display/74824/2 "2006-02-28T20:43:33Z")

</div>

Maybe I can expand on this a little bit and someone can point me in the  
right direction. I have a select menu, when something is selected in  
that menu another select menu gets filled. Everything works fine until  
there is an error on the page and when the errors are displayed those  
select menus that were filled via AJAX are now blank. So what I have  
done is I have used AJAX.Updater to force the redisplay of the select  
menus depending on what is selected in the others, now I need to see  
which one was previously selected (in the AJAX’ed menus) so that I can  
set them as selected again. Does this make sense? Am I going about  
this the wrong way?

Buntin, Seth - KATE wrote:

> Is there a way to access (from JavaScript preferably) the form array of  
> the information sent when errors are display? I want to be able to find  
> out what values were selected on the form before errors.
> 
> Seth B.
> 
> Web Resources Coordinator
> 
> Kentucky Academy of Technology Education
> 
> Murray State University
> 
> On March 1, 2006, Murray State University will begin moving all of its  
> telephone numbers in the 762- exchange to an 809- exchange.
> 
> My new number will be (270) 809-4207
