I want to open or show a popup 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 pop-up 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 this is not opening a popup. How to do it?
To pop up programmatically, you must call it using .popup('open') . Using any event, for example. focus , click , tap ... etc.
.popup('open')
focus
click
tap
Demo
$(document).on('focus', '.addpopup', function() { $('#popupAddfix').popup('open'); });
Source: https://habr.com/ru/post/1486457/More articles:Stuck in a jerk, nothing happens - gitcreate action on rails - ruby ââ| fooobar.comFinding the radius of an ellipse based on its angle from the primary or secondary axis - algorithmHow to pass parameter to jQuery plugin - javascriptExplanation of the output of this program (bit-bit in the structure) - cSide assignment of the structure of bit fields - c ++generate a list of C ++ characters for bulk refactoring / renaming - c ++How can I use the WYSIWYG editor with rails, but also have data processed by the site? - ruby-on-railsGetting multiple tables with one db call in entity infrastructure - sql-serverPython splits text and puts into array - pythonAll Articles