jquery mobile popup aspires outside of form

jquery mobile popup aspires outside of form

Hello,

I’m trying to submit a form from a popup window.

When I’m pressing the submit button nothing happens. To my surprise all the popup content is now outside of my form, that’s way no submission is taking place.

My code is looking something like this:

<form method="post" action="/MyUrl">

<a href="#positionWindow" data-rel="popup" data-position-to="window">

 

<div data-role="popup" id="positionWindow">

<input type="text" name="MyText" value="value to server">

<input type="submit" value="send">

</div>

</form>

But after jquery mobile renders the page it looks something like this:

<form method="post" action="/MyUrl">

<a href="#positionWindow" data-rel="popup" data-position-to="window">

</form>

<div data-role="popup" id="positionWindow">

<input type="text" name="MyText" value="value to server">

<input type="submit" value="send">

</div>

As you can see the content of the popup is now outside of my form so of Corse no submission will accrue.

Is there a way to prevent this behavior from happening?

Can I Couse a form submission with my own code (in jquery mobile!)?

Thanks in advance J