How can I dynamically load user-entered data as content of jquery dialog?

 
 

Share on Google+Share on Google+

Mike Lee
How can I dynamically load user-entered data as content of jquery dialog?
0 Answer(s)      2 years and 3 months ago
Posted in : JavaScript Questions

Hi I can't seem to work my javascript. I cannot seem to figure out whatelse I am missing. Kindly guide me how to solve my project please. I cannot make the value of user-entered name to show in the dialog content. I am also trying to echo this from a php file where my form is validated. Below is my code. Thanks in advance.

<?php
echo " <script type=\"text/javascript\">
    function showDialog(){

        var visitorName = $('#firstName').val();
        var myDialog = $('#acknowledge').dialog();

        myDialog.dialog({
            autoOpen:false,
            modal:true,
            buttons:{
                Close:function(){
                    $(this).dialog('close');
                    }
                    },
            title:'Form sent',
            height:'auto',
            hide:{
                effect:'explode', 
                duration:1000
                }

            });


            myDialog.dialog('open');
            myDialog.html(visitorName); 


    }
    showDialog();
    </script>";
?>
Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Advertisements

Ads

 
Advertisement null

Ads