How to get the whole form as a string
<p>I am trying to build my own form builder using javascript and php,
I have a problem getting the whole form as I want to display the same form on the other page.
I want to generate a string which contain whole form link. After clicking that link same form will be generated</p>

<p>The javascript code is</p>

<pre><code> $('document').ready(function(){
            var flag=0;
            $(".divname").draggable({
                helper : "clone"
            });

            $( ".drop_class" ).droppable({

                drop: function( event, ui ) {

                    switch(ui.helper.context.id){
                        case "heading_id":
                            $( this ).append( "&lt;div class='default_css' id='header'&gt;Write Heading Here&lt;input id='head_id' name='hello' class='common' type='text'/&gt;&lt;/div&gt;" );
                            break;
                        case "textbox_id":
                            $( this ).append( "&lt;div class='default_css'&gt;Write Text Here&lt;input id='text_id' class='common'type='text'/&gt;&lt;/br&gt;&lt;/div&gt;" );
                            break;
                        case "textarea_id":
                            $( this ).append( "&lt;div class='default_css'&gt;Enter Information&lt;textarea id='tarea_id' class='common'rows=5 cols=70&gt;&lt;/textarea&gt;&lt;/div&gt;" );
                            break;    
                        case "radio_id":
                            $( this ).append( "&lt;div class='default_css'&gt;Gender&lt;/br&gt;&lt;input type='radio' value='male' name='sex'&gt;Male&lt;br&gt;&lt;input type='radio' value='female' name='sex'&gt;Female" );
                            break;
                        case "fullname_id":
                            $( this ).append( "&lt;div class='default_css'&gt;First Name&lt;input id='fname_id' class='common' type='text'/&gt;Last Name&lt;input type='text'id='lname_id'/&gt;&lt;/br&gt;&lt;/div&gt;" );
                            break;
                        case "mobile_id":
                            $( this ).append( "&lt;div class='default_css'&gt;Enter Mobile Number&lt;input id='mob_id' class='common' type='text'/&gt;&lt;/div&gt;");
                            break;   
                        }
                        if(flag==0){
                            $( this ).append("&lt;div class='default_css'&gt;&lt;input type='button' id='submit_button' style='position:absolute;right:330px;bottom:0;'value='submit'/&gt;&lt;/div&gt;&lt;div id='generate_id'&gt;&lt;input type='button' style='position:absolute;right:100px;bottom:0;' value='Generate URL'/&gt;");
                        }
                        flag = 1;   
                    }    
                });


            });
</code></pre>

<p>How do I get whole form</p>
