hi friend i am trying to create custom dialog using j-query and inside dialog i am putting some text box and check box , but the problem is when i am displaying dialog box on button click , only the content inside the dialog will display onload and when i click on buttton it will appear in dialog only that too only first time only, what i want is it only display in dialog not onload ,and i dont want to make all component hide/show display none/block every time ,because i have many component in dialog.
here is my code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="/resources/demos/external/jquery.bgiframe-2.1.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
/*$(document).ready(function (){
$('#dialog').append('<input type="checkbox" name="vehicle" value="Car">dfhgdfg</input>');
});*/
function call(){
$(function() {
$("#dialog").dialog();
$('p').css({'display':'block'});
});
}
</script>
</head>
<body>
<div id="dialog" title="Basic dialog">
<p style="display:none;">This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
<input type="checkbox" name="vehicle" value="Car">test1</input>
<input type="checkbox" name="vehicle" value="Car">test2</input>
<input type="checkbox" name="vehicle" value="Car">test3</input>
</div>
<input type="button" onclick="call();" value="button"></input>
</body>
</html>