# User selected item of Drop Down

**URL:** <https://www.ruby-forum.com/t/user-selected-item-of-drop-down/136815>\
**Category:** Rails\
**Created:** [May 6, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/user-selected-item-of-drop-down/136815 "2008-05-06T16:55:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![OhMyRuby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/0ea827/32.png) [@OhMyRuby](https://www.ruby-forum.com/u/OhMyRuby)\
**Post date:** [May 6, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/user-selected-item-of-drop-down/136815/1 "2008-05-06T16:55:42Z")

</div>

In my view I have

form.select( :child, @children.map { | u | [0], u[1] }, { },  
{ :onchange = remote\_function(  
:url =\> {:action =\> “rjs\_call\_here”},  
:with =\> " ‘child\_picked=’ +  
escape(value)" ) } )

Everything works well with ajax and drop down menu.

My problem is that when the user hits submit I want the same drop down  
menu as above displayed but this time with  
the user selection showing.

On thought is to check in the view to see if a the user has made a  
selection and then show a different drop down.

I am not sure of what method to use in order to do this.

In other words I need to reflect user choice of the drop down after  
the user has clicked on the submit button.

---

<div class="post-metadata">

**Author:** ![OhMyRuby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/0ea827/32.png) [@OhMyRuby](https://www.ruby-forum.com/u/OhMyRuby)\
**Post date:** [May 6, 2008, 5:42pm UTC](https://www.ruby-forum.com/t/user-selected-item-of-drop-down/136815/2 "2008-05-06T17:42:58Z")

</div>

If things are not clear.

@children is set in the controller ie:

@children = [[“Select Child”, “”], [“John”, “1”], [“Mary”, “2”],  
[“Fred”, “3”] ]
