I want to open or show up popup page using java script in input text :
<input class="addpopup" type="text" name="address" id="address"></input>
<script>
$(".addpopup").click(function () {
$(this).page('#popupAddfix');
});
</script>
And popup code :
<div data-role="popup" id="popupAddfix">
<form>
<h3>Your Address</h3>
<label >Address</label>
<input type="text" name="addfix" id="fix" value=""/>
<button type="submit" >Save</button>
</form>
</div>
But it is not opening a popup. How do I make this happen ?
I want to open or show up popup page using java script in input text :
<input class="addpopup" type="text" name="address" id="address"></input>
<script>
$(".addpopup").click(function () {
$(this).page('#popupAddfix');
});
</script>
And popup code :
<div data-role="popup" id="popupAddfix">
<form>
<h3>Your Address</h3>
<label >Address</label>
<input type="text" name="addfix" id="fix" value=""/>
<button type="submit" >Save</button>
</form>
</div>
But it is not opening a popup. How do I make this happen ?
Share Improve this question asked Jun 16, 2013 at 6:02 Zakki AlawiZakki Alawi 831 gold badge1 silver badge7 bronze badges1 Answer
Reset to default 5To open popup programmatically, you need to call it using .popup('open')
. Using any event, e.g. focus
, click
, tap
...etc
Demo
$(document).on('focus', '.addpopup', function() {
$('#popupAddfix').popup('open');
});