Simple question that I have no idea of the answer to.

Is there a way to use just one xaml page (at least one "main" page) to emulate multiple pages. i.e the same as:

```
this.Frame.Navigate(typeof(Page2), null);

```

*but* using only one page?

Thanks so much, any help is appreciated.
['https://Stackoverflow.com/questions/33487368', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2463166/']
Try this:

```
var checkbox = $("#myForm").find("input[type=checkbox]");
$.each(checkbox, function(key, val) {
    formData.append($(val).attr('name'), this.is(':checked'))
});

```

It always adds the field to `FormData` with either a value of `true` when checked, or `false` when unchecked.
I took a slightly different approach from the existing answers. I created my form data variable the standard jQuery way inside my form submit event handler:

```
var form = $(this).get(0);
var formData = new FormData(form);

```

Based on [Quentin's answer](https://stackoverflow.com/a/33487482), saying that it is only set to 'on' when the `value` attribute is not available, I just added a document event on change to all checkboxes to set the value when the user checks or unchecks the input.

```
$(document).on("change", "input[type='checkbox']", function () {
    var value = $(this).prop('checked');
    $(this).val(value);
});

```

When my form data object is created in the above way, all checked checkboxes now have the value of 'true' rather than 'on'.

This worked quite nicely for my purposes and seems to me to be a pretty simple fix. Interestingly, having `value='false'` doesn't do anything as the input is just ignored and not added to the form data object if it is not checked. But obviously that still works.