Basically, I am trying to force one of my Jquery mobile popups to open up when isset($_POST["submit"])
is triggered.
Note that having the popup load on page load will not work in this situation, it must be activated when the form is submitted.
For example:
JavaScript
x
15
15
1
<?php
2
if(isset($_POST['submit']))
3
{
4
//other stuff
5
//force open popup
6
}
7
?>
8
<form method='post' action='self.php'>
9
<input type='submit' name='submit' value='submit' />
10
</form>
11
<a href="#popup" data-rel="popup" data-position-to="window" data-role="button" data-inline="true" data-icon="check" data-theme="a" data-transition="pop">popup</a>
12
<div data-role="popup" id="popupLogin" data-theme="a" class="ui-corner-all">
13
<!-- Popup contents -->
14
</div>
15
Advertisement
Answer
Can you try this one ??
JavaScript
1
6
1
<script type="text/javascript">
2
$('#form').on('submit', function () {
3
$("#popupLogin").popup("open")
4
});
5
</script>
6
Credits to Omar thanks for correcting me 🙂