?
Solved

Jquery dialog buttons problem

Posted on 2012-12-27
6
Medium Priority
?
349 Views
Last Modified: 2012-12-29
Hello experts.
Using the code below i get only the disable button.
Any help?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="jquery-ui-1.8.18.custom.css">
<script type="text/javascript" language="javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" language="javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript">
var opendialog = function(){
var p = $("#popuploader");
var end = 'End';
var disable = 'Disable';
p.dialog({
        autoOpen: false,
        bgiframe: true,
        show: "clip",
        hide: "explode",
        title: disable,
        resizable: false,
        modal: true,
        width: 400,
        height: 400
    });
p.dialog("option", "buttons", [{
        text: end, click: function () {},
        text: disable, click: function () {}
    }]).dialog("open");
}
</script>
</head>

<body>
<a href="" onclick="opendialog();return false">Open</a>
<div id="popuploader">
</div>
</body>
</html>

Open in new window

0
Comment
Question by:Panos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 38729433
Hmm, I have only seen buttons defined like


buttons: {
        'Delete': function() {
            /* Do stuff */
            $(this).dialog('close');
        },
        Cancel: function() {
            $(this).dialog('close');
        }
    },

in the dialog code

Looking around on the web, I think you want

p.dialog("option", "buttons", {
        'end': function () {},
        'disable': function () {}
    }).dialog("open");
}
0
 
LVL 2

Author Comment

by:Panos
ID: 38729443
Hi
Take a look here:
http://api.jqueryui.com/dialog/
under buttons
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 38729450
See my update.

You will need to quote the text unless end and disable are vars:


p.dialog("option", "buttons", [
       {text:'end', click: function () {} },
        {text:'disable', click: function () {}}
      ]).dialog("open");
}
0
 
LVL 2

Author Comment

by:Panos
ID: 38729515
Yes. It is working.
The problem was to put each "text:'end', click: function () {}" inside {  ... }
Thank you
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 38729516
Thank you
regards
panos
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question