0

I want to open dialogbox each time when OpenDialog() method calls each time with its contents.

Function:

function OpenDialog(){
    $("#seeContent").dialog({
                autoOpen: "false",
                stack: "true",
                height: "600",
                width: "700",
                resizable: "false"
            });
}

Function call:

<input type="button" onclick="OpenDialog()">

Note: It works fine while first call, when second call it overrides the first one.

1
  • DO NOT mix with inline...Very bad habit. Plus, we need more code. Commented Dec 15, 2012 at 6:51

2 Answers 2

1

HTML:

<input type="button" id="open_dialog">
<div id="content"></div>

JS:

$('#open_dialog').click(function(){
var data = getData();     //Get new data
$('#content').html(data); //Replace old data
$('#content').dialog({    //Open dialog
     autoOpen: "false",
     stack: "true",
     height: "600",
     width: "700",
     resizable: "false"
    });
});

Essentially, every time you click to open the dialog new data should be loaded first then open the dialog.

Sign up to request clarification or add additional context in comments.

7 Comments

bobthyasian - thanks for giving your important time but actually in my case i have only one input button and data comes through webservice as per selections, so it note possible solution for me. Is any other suggestions ??
Could you elaborate on what you mean, 'data comes through webservice'?
bobthyasian - In each call i am using web service to GET the data to XML & JSON format like that.
its not possible to put code on jsfiddle but i have edited my question with 2 additional methods.
Sorry to say, but that didn't really help. The scope of what you're doing is hard to understand without having a point of reference. But I'll update my answer to give you a better idea of how to go about doing what you want to do.
|
0

The clone() helps me to create a copy of dialog. Following is my working code.

jQuery("#seeContent").clone().dialog(
            { autoOpen: "false",
              stack: "true",
              height: "600",
              width: "700",
              resizable: "false" }
  });

I posted this answer because i could help others.

Hope, it will helps you. Thanks. !!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.