# Can I use multiple 'ORs' (||) with the onEvent block

**URL:** <https://forum.code.org/t/can-i-use-multiple-ors-with-the-onevent-block/13715>\
**Category:** Uncategorized\
**Created:** [January 16, 2018, 1:42pm UTC](https://forum.code.org/t/can-i-use-multiple-ors-with-the-onevent-block/13715 "2018-01-16T13:42:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![efarrow](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@efarrow](https://forum.code.org/u/efarrow)\
**Post date:** [January 16, 2018, 1:42pm UTC](https://forum.code.org/t/can-i-use-multiple-ors-with-the-onevent-block/13715/1 "2018-01-16T13:42:50Z")

</div>

I have a student who wrote:  
onEvent(“back1” || “back2” || “back3” || “back4” || “back5” || “back6” || “back7” || “back8” || “back9” || “back10” || “back11” || “back12”, “click”, function(event) {  
setScreen(“MainScreen”);  
});  
Clicking on the first back button goes back to the main screen. The others do not work.

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [January 16, 2018, 3:43pm UTC](https://forum.code.org/t/can-i-use-multiple-ors-with-the-onevent-block/13715/2 "2018-01-16T15:43:23Z")

</div>

No! Each button must have its own OnEvent block. This onEvent is only for “back1” and will get triggered when “back1” is clicked. All the other conditions in the OR are ignored.

---

<div class="post-metadata">

**Author:** ![efarrow](https://avatars.discourse-cdn.com/v4/letter/e/65b543/32.png) [@efarrow](https://forum.code.org/u/efarrow)\
**Post date:** [January 16, 2018, 4:23pm UTC](https://forum.code.org/t/can-i-use-multiple-ors-with-the-onevent-block/13715/3 "2018-01-16T16:23:10Z")

</div>

Thanks for your quick response!
