# Retrieving form post parameters from within a controller

**URL:** <https://www.ruby-forum.com/t/retrieving-form-post-parameters-from-within-a-controller/76182>\
**Category:** Rails\
**Created:** [November 16, 2006, 3:33pm UTC](https://www.ruby-forum.com/t/retrieving-form-post-parameters-from-within-a-controller/76182 "2006-11-16T15:33:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@danw](https://www.ruby-forum.com/u/danw)\
**Post date:** [November 16, 2006, 3:33pm UTC](https://www.ruby-forum.com/t/retrieving-form-post-parameters-from-within-a-controller/76182/1 "2006-11-16T15:33:58Z")

</div>

Hello:

I am having what would seem to be a simple problem, but I just can’t  
solve it. How do you retrieve a form’s parameters from within a  
controller?

In my form I have the following hidden field.:

I set the value of this field using javascript in my form.

I was thinking I could use the form’s POST method and retrieve the  
parameter using params[“selectedCustomerID”] in my controller. I get  
nil when this is evaluated.

What am I missing?

Thanks,

Dan

---

<div class="post-metadata">

**Author:** ![danw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@danw](https://www.ruby-forum.com/u/danw)\
**Post date:** [November 16, 2006, 3:42pm UTC](https://www.ruby-forum.com/t/retrieving-form-post-parameters-from-within-a-controller/76182/2 "2006-11-16T15:42:00Z")

</div>

well that should normally work exactly as you do it. did you check  
(e.g. with FF extension Firebug) that the vaule is set correctly by  
your JavaScript?

---

<div class="post-metadata">

**Author:** ![danw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@danw](https://www.ruby-forum.com/u/danw)\
**Post date:** [November 19, 2006, 4:28pm UTC](https://www.ruby-forum.com/t/retrieving-form-post-parameters-from-within-a-controller/76182/3 "2006-11-19T16:28:33Z")

</div>

Just google for it - I find firebug absolutely essential for any sort of  
javascript work (especially ajaxy things)

Fred

---

<div class="post-metadata">

**Author:** ![danw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@danw](https://www.ruby-forum.com/u/danw)\
**Post date:** [November 19, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/retrieving-form-post-parameters-from-within-a-controller/76182/4 "2006-11-19T16:20:45Z")

</div>

Thorsten:

I believe I did have a problem setting the value. I fixed my  
Javascript and it worked.  
By the way, what is FF extension Firebug? Maybe I could use something  
like this, if it shows  
step by step execution of Javascript.

Thanks for the help.

Dan
