Hi,

i am doing an application like a Form builder..

I am having a design page where i am generating the Fields using JQuery and displaying them each in a Div in the Preview panel of the same page.

In my code i am saving all the Fields in the Form by iterating through all the Divs in the Preview panel.

Now i want to add a functionality to show all the Divs in the preview panel in a pop - up window like when i click the Save Form button it must show all those DIvs in the Preview panel in the Window like a Preview and then it has to save the Form .

How to include the Preview option in the Code also to show the preview in a pop-up window.??

My code to save the Form is like

$("#fb_contentarea_col1down21 div").each(function() { 
                                        var checked="false";     
                                                var id=$(this).attr("id");

                                                //var fname=$("#label"+id+"").text();

                                                var fsize=$("#input"+id+"").width();

                                                var ftype=$("#input"+id+"").attr('data-attr');

                                                var finstr=$("#instr"+id+"").text();

                        var fname=$("#label"+id+"").clone().html().replace(/<span.*/,'');

                                                if($("#label"+id+"> span.req").length > 0)
                                                {

                                                 checked="true";

                                                }

                                                $.ajax({
                                                                           type: "POST",
                                                                          url: "http://localhost/FormBuilder/index.php/forms/saveField",

data: "sequence_no="+id+"&name="+fname+"&type="+ftype+"&size="+fsize+"&instr="+finstr+"&formid="+getformid+"&required="+checked,

                                                                           success: function(msg){
                                                                        //alert( "Data Saved: " + msg);
                                                                                }//success
                                                                       });//ajax




                        });//Loop

My fb_contentarea_col1down21 has all the Divs showing all the Fields of my Form.

I am iterating through it and saving all the Fields.

How to make all these to show like a preview in a pop-up window using JQuery....

not a real popup window, just a little one on top of the page? its an absolutely positioned div on top of the page. You just need to set its top left attributes to position it, then toggle the display attribute to make it appear and disappear. :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.