943,018 Members | Top Members by Rank

Ad:
Aug 3rd, 2009
0

Pop up window using JQuery

Expand Post »
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

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. $("#fb_contentarea_col1down21 div").each(function() {
  2. var checked="false";
  3. var id=$(this).attr("id");
  4.  
  5. //var fname=$("#label"+id+"").text();
  6.  
  7. var fsize=$("#input"+id+"").width();
  8.  
  9. var ftype=$("#input"+id+"").attr('data-attr');
  10.  
  11. var finstr=$("#instr"+id+"").text();
  12.  
  13. var fname=$("#label"+id+"").clone().html().replace(/<span.*/,'');
  14.  
  15. if($("#label"+id+"> span.req").length > 0)
  16. {
  17.  
  18. checked="true";
  19.  
  20. }
  21.  
  22. $.ajax({
  23. type: "POST",
  24. url: "http://localhost/FormBuilder/index.php/forms/saveField",
  25.  
  26. data: "sequence_no="+id+"&name="+fname+"&type="+ftype+"&size="+fsize+"&instr="+finstr+"&formid="+getformid+"&required="+checked,
  27.  
  28. success: function(msg){
  29. //alert( "Data Saved: " + msg);
  30. }//success
  31. });//ajax
  32.  
  33.  
  34.  
  35.  
  36. });//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....
Last edited by peter_budo; Aug 4th, 2009 at 6:22 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arunajasmine is offline Offline
18 posts
since Jul 2009
Aug 3rd, 2009
0

Re: 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.
Reputation Points: 14
Solved Threads: 22
Junior Poster
JugglerDrummer is offline Offline
138 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: How to add a "Bookmark This" link?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: html help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC