Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Hey Try This Code to make model popup.</p> <pre><code>&lt;h3&gt;JQuery Popup Dialogs&lt;/h3&gt; &lt;input type="button" id="btnShowSimple" value="Simple Dialog" /&gt; &lt;input type="button" id="btnShowModal" value="Modal Dialog" /&gt; &lt;br /&gt;&lt;br /&gt; &lt;div id="output"&gt;&lt;/div&gt; &lt;div id="overlay" class="web_dialog_overlay"&gt;&lt;/div&gt; &lt;div id="dialog" class="web_dialog"&gt; &lt;table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0"&gt; &lt;tr&gt; &lt;td class="web_dialog_title"&gt;Online Survey&lt;/td&gt; &lt;td class="web_dialog_title align_right"&gt; &lt;a href="#" id="btnClose"&gt;Close&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" style="padding-left: 15px;"&gt; &lt;b&gt;Choose your favorite mobile brand? &lt;/b&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" style="padding-left: 15px;"&gt; &lt;div id="brands"&gt; &lt;input id="brand1" name="brand" type="radio" checked="checked" value="Nokia" /&gt; Nokia &lt;input id="brand2" name="brand" type="radio" value="Sony" /&gt; Sony &lt;input id="brand3" name="brand" type="radio" value="Motorola" /&gt; Motorola &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2" style="text-align: center;"&gt; &lt;input id="btnSubmit" type="button" value="Submit" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p><strong>JS Code is</strong></p> <pre><code>(document).ready(function () { $("#btnShowSimple").click(function (e) { ShowDialog(false); e.preventDefault(); }); $("#btnShowModal").click(function (e) { ShowDialog(true); e.preventDefault(); }); $("#btnClose").click(function (e) { HideDialog(); e.preventDefault(); }); $("#btnSubmit").click(function (e) { var brand = $("#brands input:radio:checked").val(); $("#output").html("&lt;b&gt;Your favorite mobile brand: &lt;/b&gt;" + brand); HideDialog(); e.preventDefault(); }); </code></pre> <p>});</p> <pre><code> function ShowDialog(modal) { $("#overlay").show(); $("#dialog").fadeIn(300); if (modal) { $("#overlay").unbind("click"); } else { $("#overlay").click(function (e) { HideDialog(); }); } </code></pre> <p>}</p> <pre><code> function HideDialog() { $("#overlay").hide(); $("#dialog").fadeOut(300); } </code></pre> <p>Try That link for Live Demo</p> <p><a href="http://jsfiddle.net/dubeynee/937kH/" rel="nofollow"><strong>Live Demo</strong></a> </p> <h2>Hope It helps you</h2>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload