Try this:
<!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> <!-- jQuery--> <script type="text/javascript" src="jquery-ui-1.7.2.custom/js/jquery-1.3.2.min.js"></script> <!-- END jQuery--> <!-- jQuery UI--> <link type="text/css" href="jquery-ui-1.7.2.custom/css/custom-theme/jquery-ui-1.7.2.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="jquery-ui-1.7.2.custom/js/jquery-ui-1.7.2.custom.min.js"></script> <!-- END jQuery UI--> <script type="text/javascript"> $.ui.dialog.defaults.bgiframe = true; $(document).ready( function(){ //define config object var dialog_opts = { closeOnEscape: true, bgiframe: true, resizable: false, height: 500, width: 400, modal: true, close: function() { $(this).dialog('destroy'); }, overlay: { background: "url(img/modal.png) repeat" }, buttons: { //define buttons function 'OK': function() { $(this).dialog('close'); }, Cancel : function() { $(this).dialog('close'); } } }; $("#opendialog").click( function() { $("#dialog").dialog(dialog_opts); }); $("#ContentSelect").change(function () { var str = ""; $("#ContentSelect option:selected").each(function () { str = $('#ContentSelect').val() + ".php"; }); $('#ContentHere').load(str); }).change(); }); </script> </head> <body> <!-- DIALOG HERE --> <div id="dialog" title="Basic dialog" style="display:none;"> <select name="ContentSelect" id="ContentSelect" style="width:280px;float:left; margin-left:5px; margin-right:5px;"> <option value="content1">Content 1</option> <option value="content2">Content 2</option> <option value="content3">Content 3</option> <option value="content4">Content 4</option> </select> <div id="ContentHere"></div> </div> <!-- END DIALOG HERE --> <div id="opendialog" style="margin-top:5px;"><a href="#" title="Open Dialog">Open Dialog</a></div> </body> </html> then, make php page with name content1.php, content2.php, content3.php and content4.php. This page will load with select box function. Ok, I hope this will helping you... Salam, Yudhi Armyndharis a.ka Computeraholic | Web Developer http://www.jayakreasi.com http://www.bitdev.org Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html> - "Computers are useless. They can only give you answers." On Sun, Aug 9, 2009 at 11:43 PM, codepress <[email protected]> wrote: > > I have a page called fungo.php that opens a dialog using some example > code -- This part works ok: > > > <?php > require_once("/var/www/config.php"); > $tc=array('Joe', 'Biff'); > > ?> > > <!doctype html> > <html> > <meta charset="utf-8"> > <title>Loading a page into a dialog</title> > > <link rel="stylesheet" type="text/css" href="http:// > ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery- > ui.css"> > <style type="text/css"> > #tire-specs { > border-collapse: collapse; > } > #tire-specs th, > #tire-specs td { > padding: 2px 5px; > border: 1px solid #000; > } > </style> > > <script type="text/javascript" src="<?php echo $js_JQuery; ?>"> </ > script> > <script type="text/javascript" src="<?php echo $js_form; ?>"></script> > <script type="text/javascript" src="<?php echo $js_ajax; ?>"></script> > <script type="text/javascript" src="<?php echo $js_livequery; ?>"></ > script> > > <link type="text/css" href="http://192.168.1.100/apps/ctracker/ > library/js/Jqtheme/development-bundle/themes/redmond/ui.all.css<http://192.168.1.100/apps/ctracker/%0Alibrary/js/Jqtheme/development-bundle/themes/redmond/ui.all.css> > " > rel="stylesheet" /> > <script type="text/javascript" src="js/ui.core.js"></script> > <script type="text/javascript" src="js/ui.draggable.js"></script> > <script type="text/javascript" src="js/ui.resizable.js"></script> > <script type="text/javascript" src="js/ui.dialog.js"></script> > > <script type="text/javascript"> > $(document).ready(function() { > $('#tire-specs th a').each(function() { > var $link = $(this); > var $dialog = $('<div></div>') > .load($link.attr('href') + ' #content') > .dialog({ > autoOpen: false, > title: $link.attr('title'), > modal: true, > width: 600 > }); > > $link.click(function() { > $dialog.dialog('open'); > > return false; > }); > }); > }); > </script> > > <script type="text/javascript"> > $(document).ready(function() > { > $('a.ajaxify').livequery(function(){ > $(this).ajaxify({ > target: '#container' > }); > }); > > }); > </script> > > </head> > <body> > > <p>This is an example from the Nemikor Blog article <a href="http:// > blog.nemikor.com/2009/04/18/loading-a-page-into-a-dialog/">Loading a > page into a dialog</a>.</p> > > <h2>Michelin Primacy MXV4</h2> > > <?php foreach ($tc as $t) { ?> > > <table id="tire-specs"> > <thead> > <tr> > <th>Size</th> > <th><a href="drops.php?name=<?php echo $t; ?>" > title="Uniform Tire > Quality Grade">Uniform Tire Quality Grade</a></th> > <th>Max Load</th> > <th>Max Inflation Pressure</th> > > <th>Tread Depth</th> > </tr> > </thead> > <tbody> > <tr> > <td>205/65R15</td> > <td>620 A A</td> > > <td>1477 lbs.</td> > <td>44 psi</td> > <td>11/32"</td> > </tr> > </tbody> > </table><br> > > <?php } ?> > > </body> > </html> > > It loads the contents of this page into the dialog: > > <?php > require_once("/var/www/config.php"); > > ?> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// > www.w3.org/TR/html4/loose.dtd"> > <html> > <head> > > > > </head> > <body> > > <div id="content"> > > > > > <a class="ajaxify" href="content.php">Click</a> > > > > > </div> > > <div id="container"></div> > > </body> > </html> > > The linked content will not load inside the dialog box -- nothing > happens. If I move the <div> > <div id="container"></div> > to the initial page the ajax works but does not load inside the dialog > box. > > How do I get the content of the content.php page to load inside the > dialog box? > > Thanks, > SW > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
