# \#Rawabi, Redirect page when a key pressed

**URL:** <https://forum.wixstudio.com/t/rawabi-redirect-page-when-a-key-pressed/27396>\
**Category:** Ask the community\
**Tags:** code, question\
**Created:** [March 1, 2018, 12:45pm UTC](https://forum.wixstudio.com/t/rawabi-redirect-page-when-a-key-pressed/27396 "2018-03-01T12:45:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nabeel-zanabeet](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/nabeel-zanabeet/32/2208_2.png) [@nabeel-zanabeet](https://forum.wixstudio.com/u/nabeel-zanabeet)\
**Post date:** [March 1, 2018, 12:45pm UTC](https://forum.wixstudio.com/t/rawabi-redirect-page-when-a-key-pressed/27396/1 "2018-03-01T12:45:24Z")

</div>

Any ideas !!  
Thnx 🙂

---

<div class="post-metadata">

**Author:** ![roi-bendet](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/roi-bendet/32/1283_2.png) [@roi-bendet](https://forum.wixstudio.com/u/roi-bendet)\
**Post date:** [March 1, 2018, 2:24pm UTC](https://forum.wixstudio.com/t/rawabi-redirect-page-when-a-key-pressed/27396/2 "2018-03-01T14:24:52Z")

</div>

Hi Nabeel,  
Can you please share more details ?  
At this moment it is only possible to add onKeyPress event to a user input element.  
Roi

---

<div class="post-metadata">

**Author:** ![nabeel-zanabeet](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/nabeel-zanabeet/32/2208_2.png) [@nabeel-zanabeet](https://forum.wixstudio.com/u/nabeel-zanabeet)\
**Post date:** [March 1, 2018, 6:06pm UTC](https://forum.wixstudio.com/t/rawabi-redirect-page-when-a-key-pressed/27396/3 "2018-03-01T18:06:38Z")

</div>

Hi Roi, Yeah i want to attach that (onKeyPress)event to the page it self … for example when a visitor enter the website if he press EnterKey he will be directed to another page !!  
Or we can solve this by a popup question on home page loading … But how !!  
thank you

---

<div class="post-metadata">

**Author:** ![abdullah-qabaja](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/abdullah-qabaja/32/2246_2.png) [@abdullah-qabaja](https://forum.wixstudio.com/u/abdullah-qabaja)\
**Post date:** [March 1, 2018, 7:16pm UTC](https://forum.wixstudio.com/t/rawabi-redirect-page-when-a-key-pressed/27396/4 "2018-03-01T19:16:51Z")

</div>

Hi Dear, if you mean that you want to redirect to the home page for example when someone clicks on the home button, just import wixLocation from ‘wix-location’; to the page that contains the button  
and through the developers tool fire the on click event and inside that event write that code:  
wixLocation.to(“your location”);  
Regards,  
#Rawabi

---

<div class="post-metadata">

**Author:** ![nabeel-zanabeet](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/nabeel-zanabeet/32/2208_2.png) [@nabeel-zanabeet](https://forum.wixstudio.com/u/nabeel-zanabeet)\
**Post date:** [March 1, 2018, 8:39pm UTC](https://forum.wixstudio.com/t/rawabi-redirect-page-when-a-key-pressed/27396/5 "2018-03-01T20:39:13Z")

</div>

Thanks 🙂  
I wanna do that with a key pressed , not with a button  
action listener for the hole page on key pressed
