<div>Your problem is that you would like a category checked to be shown, right? then the code </div>
<div><font face="courier new,monospace">&lt;div id=&quot;subcategories_&lt;%= </font><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://category.name/" target="_blank"><font face="courier new,monospace">
category.name</font></a><font face="courier new,monospace"> %&gt;&quot;&nbsp; style=&quot;display:none&quot;&gt;</font></div>
<div><font face="">Should be replaced by </font></div>
<div>&lt;div id=&quot;subcategories_&lt;%= <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://category.name/" target="_blank">category.name</a> %&gt;&quot;&nbsp; &lt;%= 'style=&quot;display:none&quot;' if @
listing.categories.include? category&nbsp; %&gt; &gt;</div>
<div>&nbsp;</div>
<div>Regards</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 4/1/06, <b class="gmail_sendername">Adam Bloom</b> &lt;<a href="mailto:admanb@gmail.com">admanb@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I'm having one problem. In my code, inside the &lt;input ... &gt; tag I have:<br><br>&lt;% if @listing.categories.include
? category %&gt;checked=&quot;checked&quot;&lt;% end %&gt;<br><br>because the same form that's used to create is used to edit. Obviously<br>this results in the categories being checked, but the subcategories<br>aren't toggled on. I tried this inside the &lt;div id=&quot;categories&quot;&gt;:
<br><br>&lt;% if @listing.categories.include? category %&gt;<br>&nbsp;&nbsp;&lt;script language=&quot;javascript&quot;<br>type=&quot;text/javascript&quot;&gt;Element.toggle('subcategories_&lt;%=category.name%&gt;');&lt;/script&gt;<br>
&lt;% end %&gt;<br><br>but it didn't togggle...<br><br>Sorry, I'm still a newbie at all of this.<br><br>Thanks again,<br><br>Adam<br><br>--<br>Posted via <a href="http://www.ruby-forum.com/">http://www.ruby-forum.com/</a>
.<br>_______________________________________________<br>Rails mailing list<br><a href="mailto:Rails@lists.rubyonrails.org">Rails@lists.rubyonrails.org</a><br><a href="http://lists.rubyonrails.org/mailman/listinfo/rails">http://lists.rubyonrails.org/mailman/listinfo/rails
</a><br></blockquote></div><br>