# How to use input from text\_field via a button..?

**URL:** <https://www.ruby-forum.com/t/how-to-use-input-from-text-field-via-a-button/92090>\
**Category:** Rails\
**Created:** [April 16, 2007, 12:35am UTC](https://www.ruby-forum.com/t/how-to-use-input-from-text-field-via-a-button/92090 "2007-04-16T00:35:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wintermute](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e19b73/32.png) [@wintermute](https://www.ruby-forum.com/u/wintermute)\
**Post date:** [April 16, 2007, 12:35am UTC](https://www.ruby-forum.com/t/how-to-use-input-from-text-field-via-a-button/92090/1 "2007-04-16T00:35:19Z")

</div>

Hi,

This is most likely trivial but I cannot find it anywhere… I have a  
text\_field and a button. I would like to use the input in the  
text\_field as a value to compare against a column in a mySQL database  
that’s not the id (call it ‘name’). How can I do this?

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![wintermute](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/e19b73/32.png) [@wintermute](https://www.ruby-forum.com/u/wintermute)\
**Post date:** [April 16, 2007, 7:19am UTC](https://www.ruby-forum.com/t/how-to-use-input-from-text-field-via-a-button/92090/2 "2007-04-16T07:19:48Z")

</div>

You would have to submit the form and do the comparison in the  
controller. The value for the textfield should come in the params[]  
hash.

wintermute wrote:

> Hi,
> 
> This is most likely trivial but I cannot find it anywhere… I have a  
> text\_field and a button. I would like to use the input in the  
> text\_field as a value to compare against a column in a mySQL database  
> that’s not the id (call it ‘name’). How can I do this?
> 
> Thanks for any help.
