How do I launch a dialog with a button?
This is my first day with jquery, and I can't figure out this simple
task! I'd like to launch a dialog when a user clicks a button (or a
link, not sure what to use).
This is what I'm doing now:
With this the dialog doesn't launch from the button and the content
displays on the page. If I remove the bottom $
("newusrprizebtn").onclick({ $("#newusrprize").dialog('open'); });
then the dialog pops up on page load.
<script type="text/javascript">
{literal}
$("#newusrprize").dialog({
autoOpen: false,
height: 494,
width: 800,
bgiframe: true,
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
}
});
$("newusrprizebtn").onclick({
$("#newusrprize").dialog('open');
});
{/literal}
</script>
Thank you so much!
PS : the literal code is because I'm using Smarty templates.