# Hiding multiple id's \[element.hide\]

**URL:** <https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943>\
**Category:** Rails\
**Created:** [November 22, 2006, 6:11pm UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943 "2006-11-22T18:11:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 22, 2006, 6:11pm UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/1 "2006-11-22T18:11:11Z")

</div>

I’m looking at this changeset [http://dev.rubyonrails.org/changeset/5057](http://dev.rubyonrails.org/changeset/5057)  
and I’m running edge revision 5196 so I’m assuming multiple id’s on  
element.hide would work.  
I’m getting parse errors though

(“Toggle Info”, :after =\> “Element.hide(“basic”,“intermediate”)”)

–

> **[Dark ambient](https://en.wikipedia.org/wiki/Dark_ambient)**
>
> Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla 
> The te...

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 22, 2006, 8:03pm UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/2 "2006-11-22T20:03:35Z")

</div>

Multiple ids do not work with the latest prototype anymore.

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 22, 2006, 8:23pm UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/3 "2006-11-22T20:23:37Z")

</div>

On 11/22/06, krunk- [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Multiple ids do not work with the latest prototype anymore.

So what is on the Scriptaculous site about multiple id’s is no longer  
valid  
?  
Weird.

Stuart

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 22, 2006, 8:33pm UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/4 "2006-11-22T20:33:39Z")

</div>

Also, right now I’ve created 5 divs , each one with STYLE=“display:  
none;”  
Then I have 5 seperate link\_to\_remotes with :after =\> Element.show  
(‘somediv’)  
However , what I can’t seem to figure out is what one element is showing  
and  
another is clicked  
then 2 divs are showing.  
I would like 1 div at a time, where the first one goes away when the  
second  
is clicked ?  
Is there a way to do this ?

Stuart  
On 11/22/06, Dark A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> So what is on the Scriptaculous site about multiple id’s is no longer  
> valid ?  
> Weird.
> 
> Stuart

–

> **[Dark ambient](https://en.wikipedia.org/wiki/Dark_ambient)**
>
> Dark ambient (referred to as ambient industrial especially in the 1980s) is a genre of post-industrial music that features an ominous, dark droning and often gloomy, monumental or catacombal atmosphere, partially with discordant overtones. It shows similarities with ambient music, a genre that has been cited as a main influence by many dark ambient artists, both conceptually and compositionally. Although mostly electronically generated, dark ambient also includes the sampling of hand-pla 
> The te...

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 23, 2006, 3:48am UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/5 "2006-11-23T03:48:35Z")

</div>

On 11/22/06, Maxim K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > then 2 divs are showing.  
> > I would like 1 div at a time, where the first one goes away when the  
> > second  
> > is clicked ?  
> > Is there a way to do this ?  
> > You can Element.hide each of 5 divs before Element.show’ing the next one.

Okay, that encouraging, and how would I do this ?

Stuart

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 23, 2006, 3:08am UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/6 "2006-11-23T03:08:29Z")

</div>

On 11/22/06, Dark A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Also, right now I’ve created 5 divs , each one with STYLE=“display: none;”  
> Then I have 5 seperate link\_to\_remotes with :after =\>  
> Element.show(‘somediv’)  
> However , what I can’t seem to figure out is what one element is showing and  
> another is clicked  
> then 2 divs are showing.  
> I would like 1 div at a time, where the first one goes away when the second  
> is clicked ?  
> Is there a way to do this ?  
> You can Element.hide each of 5 divs before Element.show’ing the next  
> one.

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 23, 2006, 9:03am UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/7 "2006-11-23T09:03:06Z")

</div>

On 23 November 2006 05:46, Dark A. wrote:

> > You can Element.hide each of 5 divs before Element.show’ing the next one.  
> > Okay, that encouraging, and how would I do this ?  
> > Element.hide(‘div1’);  
> > Element.hide(‘div2’);  
> > Element.hide(‘div3’);  
> > Element.hide(‘div4’);  
> > Element.hide(‘div5’);  
> > Element.show(‘div3’);

or equal in RJS:

[‘div1’, ‘div2’, ‘div3’, ‘div4’, ‘div5’].each do |element\_id  
page.hide element\_id  
end  
page.show @next\_element\_id

---

<div class="post-metadata">

**Author:** ![zanoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/e99b99/32.png) [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Post date:** [November 23, 2006, 4:33pm UTC](https://www.ruby-forum.com/t/hiding-multiple-ids-element-hide/76943/8 "2006-11-23T16:33:10Z")

</div>

On 11/23/06, Maxim K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Element.hide(‘div5’);  
> Element.show(‘div3’);

Using the above -  
\<%= link\_to\_remote (“Basic Info”,  
Element.hide  
(‘canbckground’);  
Element.hide  
(‘canposition’);  
Element.hide(‘canskill’);

Element.show(‘basicinfo’);%\>

Getting this error:

SyntaxError in Candidates#show

Showing _app/views/candidates/show.rhtml_ where line _#3_ raised:

compile error  
./script/…/config/…/app/views/candidates/show.rhtml:3: parse error,  
unexpected ‘;’, expecting ‘)’

I tried a few different ways of writing it.  
Any right way ?

TIA  
Stuart
