Nikola's comment about needing $(document).ready() is most likely the
cause of your problem.  However, if you sample code you've got this
line:

$("newusrprizebtn").onclick({

which I'm assuming is supposed to be:

$("#newusrprizebtn").onclick({


On May 5, 4:30 pm, a_frenchswallow <[email protected]> wrote:
> 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.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to