# Link\_to Tag, Onclick Event

**URL:** <https://www.ruby-forum.com/t/link-to-tag-onclick-event/146245>\
**Category:** Rails\
**Created:** [August 19, 2008, 12:52pm UTC](https://www.ruby-forum.com/t/link-to-tag-onclick-event/146245 "2008-08-19T12:52:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gandhi-tush](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Post date:** [August 19, 2008, 12:52pm UTC](https://www.ruby-forum.com/t/link-to-tag-onclick-event/146245/1 "2008-08-19T12:52:26Z")

</div>

Hi,  
I want to do like this :-

using Link\_to tag.  
Where - validate() is an java script function in that RHTML file.

Is this is possible using link\_to tag? If yes tell me hoe to do that?

Thanks & Regards,  
Tushar

---

<div class="post-metadata">

**Author:** ![gandhi-tush](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/5daacb/32.png) [@gandhi-tush](https://www.ruby-forum.com/u/gandhi-tush)\
**Post date:** [August 19, 2008, 12:55pm UTC](https://www.ruby-forum.com/t/link-to-tag-onclick-event/146245/2 "2008-08-19T12:55:20Z")

</div>

On 19 Aug 2008, at 11:52, Tushar G. wrote:

> Hi,  
> I want to do like this :-
> 
> using Link\_to tag.  
> Where - validate() is an java script function in that RHTML file.
> 
> Is this is possible using link\_to tag? If yes tell me hoe to do that?

link\_to\_function will do that.

Fred
