# Css question

**URL:** <https://www.ruby-forum.com/t/css-question/79399>\
**Category:** Rails\
**Created:** [March 10, 2006, 8:28am UTC](https://www.ruby-forum.com/t/css-question/79399 "2006-03-10T08:28:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [March 10, 2006, 8:28am UTC](https://www.ruby-forum.com/t/css-question/79399/1 "2006-03-10T08:28:44Z")

</div>

I’m doing this ‘partial’ to do some ajax auto\_complete

\<% for client in @clients do -%\>- 
\<%=h client.clwholename %\>

\<%= client.id %\>
\<% end -%\>

and my understanding was that would make the  
element inside ‘hidden’ but that isn’t the case as it is visible.

so I added a class to the stylesheet the document is using…

.informal {  
visibility : hidden;  
}

and saved it but still the data inside is visible.

Is there something I am still missing?

Craig

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [March 10, 2006, 9:11am UTC](https://www.ruby-forum.com/t/css-question/79399/2 "2006-03-10T09:11:00Z")

</div>

> \<% for client in @clients do -%\>- 
> \<%=h client.clwholename %\>
> 
> \<%= client.id %\>
> \<% end -%\>

You are missing a parenthesis in the '\<div class="id ’ tag after the  
“id” property

Matt

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [March 10, 2006, 3:16pm UTC](https://www.ruby-forum.com/t/css-question/79399/3 "2006-03-10T15:16:13Z")

</div>

On Fri, 2006-03-10 at 09:08 +0100, Matthias von Rohr wrote:

> 

* * *

duh - good catch…interesting that it worked at all. In fact, fixing it  
breaks it and I think I can finally ask an intelligent question about  
this.

I am returning client.id to my form (whether visible or not is probably  
not meaningful at the moment).

I want to submit this value obtained via ajax/auto\_complete with my  
post.

If I add  
\<%= hidden\_field ‘placement’,‘id’ %\>  
immediately after  
\<%= text\_field\_with\_auto\_complete :placement, :clwholename, {} %\>

the POST includes

Processing PlacementsController#findresult (for 127.0.0.1 at 2006-03-10  
06:53:14) [POST]  
Parameters: {“commit”=\>“Find”, “action”=\>“findresult”,  
“controller”=\>“placements”, “placement”=\>{“id”=\>"",  
“beg\_referral\_date”=\>"", “clwholename”=\>“George Washington”}}

so the value returned is blank for ‘id’ but clearly there for  
‘clwholename’

Obviously this ‘id’ value is returning to the form via autocomplete, I  
can see it there both on screen (until I set css invisible) and in DOM  
inspector where it shows up as a

 with node\_value of “id” just  
below the 
 with node\_value of “clwholename” but I need that value  
returned when I ‘POST’ the form.

any clues?

Craig

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [March 10, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/css-question/79399/4 "2006-03-10T19:17:27Z")

</div>

On Fri, 2006-03-10 at 07:10 -0700, Craig W. wrote:

One more time at this because someone knows the answer to this and I’m  
not getting it.

using text\_field\_with\_auto\_complete

It searches db fine, returns with list of 2 related  
columns…clwholename and id

It returns to the calling form by way of a partial that has 2

 but  
separate class names (see below for actual code)

Both values return to web app and can be seen inside same

- (via DOM  
inspector) as separate 
 with their respective NodeValues and text  
values (the part I want).

But when the form is POSTed, I get the value from  
\<%= text\_field\_with\_auto\_complete :placement, :clwholename, {} %\>  
But not from  
\<%= hidden\_field ‘placement’, ‘id’ %\>  
or  
\<%= hidden\_field :placement, :id %\>

In essence, I want the ‘id’ from the auto\_complete selection to tag  
along with the post so I don’t have to look it up again afterwards  
because that is too painful.

Craig
