# How to cancel navigation?

**URL:** <https://forum.servoy.com/t/how-to-cancel-navigation/18029>\
**Category:** Classic Servoy\
**Created:** [June 18, 2014, 10:20am UTC](https://forum.servoy.com/t/how-to-cancel-navigation/18029 "2014-06-18T10:20:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergei.sheinin](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@sergei.sheinin](https://forum.servoy.com/u/sergei.sheinin)\
**Post date:** [June 18, 2014, 10:20am UTC](https://forum.servoy.com/t/how-to-cancel-navigation/18029/1 "2014-06-18T10:20:19Z")

</div>

I have a form with tabless panel that contains another form. When navigation on parent form is clicked I would like to prompt a user with “Cancel: yes/no” choice in case changes were made to child form and not saved. I am trying this:

```auto
// form's "onRecordSelection" event
function nav(){
	if( plugins.dialogs.showQuestionDialog('Confirm','Cancel?','yes','no')==='no'){
		return false}}

```

If I click “no” the actual navigation doesn’t happen but row number in the navigator changes to next record. Obviously it should stay at same record number.

How can the desired functionality be attained?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [October 23, 2014, 10:26am UTC](https://forum.servoy.com/t/how-to-cancel-navigation/18029/2 "2014-10-23T10:26:06Z")

</div>

returning false on a on record selection doesn’t do anything  
Because that is an “after the fact” event so the selection is already changed.

So you just have to set it back to the desired selection.
