'Showing content in Jquery modal dialog doesn't work

I have this simple form:

<form id="data_form">
    [.....]
    <div id="messages_box" class="messages_box">
        <p id="messages_label"></p>
    </div>
</form>

where I put a div for dialog messages. And I have this code:

$data_complete = __('Data are completed. Please login with account just registered!','xxxxxxxxxxx');
?>
    <script type="text/javascript">
        jQuery(document).ready(function ($) {
            $("#messages_label").text('<?php $data_complete; ?>');
            $('#messages_box').dialog({ 
                modal: true, 
                title: 'Success',
                overflow:"auto",
                closeOnEscape: false, 
                buttons: { Ok: function() { 
                                    $( this ).dialog( "close" ); 
                                    $("#data_form").find('input,select').val('');
                                } 
                        },
                open: function(event, ui) {
                    $(event.target).dialog('widget').css({ position: 'fixed' }).position({ my: 'center', at: 'center', of: window });
                    $(".ui-dialog-titlebar-close", ui.dialog || ui).hide();
                }
            });
        });
    </script>
<?php

where I pass correctly some content to the <p></p> identified with id as messages_label with

$("#messages_label").text('<?php $data_complete; ?>');

but when I show the dialog messages_label's content doesn't show.... Maybe I missed something?

Thanks in advance! Cheers!



Solution 1:[1]

At the end , I solved the problem using an external plugin, Zebra dialog box and now I am satisfied to see an elegant modal message box.... Thanks to everyone anyway! Cheers!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Luigino