Thanks to both of you for the help. Your comments helped steer me in the right direction.<br><br>I'm using the behaviour.js library so has allowed me to simplify it somewhat. Here is my js:<br><br>&nbsp;&nbsp;&nbsp; '.tag_link' : function(el){
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; el.onclick = function(){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var str = document.tag_form.discover.value + &quot;, &quot; + el.rel<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; document.tag_form.discover.value = str;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; },<br><br>And my form:<br>
<br>&lt;form name=&quot;tag_form&quot;&gt;<br>&lt;input type=&quot;text&quot; name=&quot;all&quot; id=&quot;discover&quot; size=&quot;16&quot; value=&quot;test1, test2&quot;/&gt;<br>&lt;a href=&quot;#&quot; rel=&quot;mytag1&quot; class=&quot;tag_link&quot;&gt;click me&lt;/a&gt;&lt;br /&gt;
<br>&lt;a href=&quot;#&quot; rel=&quot;mytag2&quot; class=&quot;tag_link&quot;&gt;click me&lt;/a&gt;&lt;br /&gt;<br>&lt;a href=&quot;#&quot; rel=&quot;mytag3&quot; class=&quot;tag_link&quot;&gt;click me&lt;/a&gt;&lt;br /&gt;
<br>&lt;/form&gt;<br><br>It validates (except for not having an action in the form tag, which I'll add in a bit. Does anyone see any problems with this? Seems to work fine. <br><br>Steve<br><a href="http://www.smarkets.net">
http://www.smarkets.net</a><br><br><div><span class="gmail_quote">On 3/31/06, <b class="gmail_sendername"><a href="mailto:njmacinnes@gmail.com">njmacinnes@gmail.com</a></b> &lt;<a href="mailto:njmacinnes@gmail.com">njmacinnes@gmail.com
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Well, first of all, the button should be between the &lt;form&gt; ...<br>
&lt;/form&gt; tags (it should work even if not, but lets just be strictly<br>correct).<br>Your form needs a name, for example &lt;form name=&quot;form1&quot;&gt;. Then its'<br>onClick=&quot;document.form1.discover.value = test3, test4&quot; Notice only one
<br>equals, not two? That should sort it out. Hope that's helped.<br>-N<br><br>On 31/03/06, Steve Odom &lt;<a href="mailto:steve.odom@gmail.com">steve.odom@gmail.com</a>&gt; wrote:<br>&gt; Hi list,<br>&gt;<br>&gt; I have a list of tags. I want to be able to click on a tag and have that tag
<br>&gt; name populate an input field. I think delicious used to allow you to click<br>&gt; on existing links to tag your bookmark similar to this (moving instead to<br>&gt; auto_complete).<br>&gt;<br>&gt; My guess is the code looks something like this....
<br>&gt; &lt;form&gt;<br>&gt; &lt;input type=&quot;text&quot; name=&quot;all&quot; id=&quot;discover&quot; size=&quot;16&quot; value=&quot;test1, test2&quot;/&gt;<br>&gt; &lt;/form&gt;<br>&gt;<br>&gt; &lt;a href onClick=&quot;
document.form.discover.value == 'test3, test4'&quot;&gt;click<br>&gt; me&lt;/a&gt;<br>&gt;<br>&gt; ...but I can't get it to work. Any suggestions?<br>&gt;<br>&gt; Thanks,<br>&gt;<br>&gt; Steve<br>&gt;&nbsp;&nbsp;<a href="http://www.smarkets.net">
http://www.smarkets.net</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; Rails mailing list<br>&gt; <a href="mailto:Rails@lists.rubyonrails.org">Rails@lists.rubyonrails.org</a><br>&gt; <a href="http://lists.rubyonrails.org/mailman/listinfo/rails">
http://lists.rubyonrails.org/mailman/listinfo/rails</a><br>&gt;<br>&gt;<br>&gt;<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>