# Mixing JS with check\_box\_tag

**URL:** <https://www.ruby-forum.com/t/mixing-js-with-check-box-tag/147371>\
**Category:** Rails\
**Created:** [September 1, 2008, 5:15am UTC](https://www.ruby-forum.com/t/mixing-js-with-check-box-tag/147371 "2008-09-01T05:15:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![splashlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@splashlin](https://www.ruby-forum.com/u/splashlin)\
**Post date:** [September 1, 2008, 5:15am UTC](https://www.ruby-forum.com/t/mixing-js-with-check-box-tag/147371/1 "2008-09-01T05:15:41Z")

</div>

I have a check\_box\_tag in my code that the user clicks to add more  
information. When the checkbox is checked or unchecked I want to call a  
JS function I have written called toggleBox(). Does anyone know how to  
do this?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![splashlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@splashlin](https://www.ruby-forum.com/u/splashlin)\
**Post date:** [September 1, 2008, 10:16am UTC](https://www.ruby-forum.com/t/mixing-js-with-check-box-tag/147371/2 "2008-09-01T10:16:54Z")

</div>

On Sep 1, 4:15 am, Phil J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have a check\_box\_tag in my code that the user clicks to add more  
> information. When the checkbox is checked or unchecked I want to call a  
> JS function I have written called toggleBox(). Does anyone know how to  
> do this?

pass an onclick option to the checkbox.

Fred
