Solved

Jquery ui dialog help

Posted on 2011-03-24
1
298 Views
Last Modified: 2012-05-11
$('#upimage1').click(function(){
	var up = '<input id="file_upload" name="file_upload" type="file" />';
	$("#dialog1").html(up);
	
		$( "#dialog1" ).dialog({
			width: 400,
			height: 175,
			modal: true
		});
		
	$('#file_upload').uploadify({
    'uploader'  : 'uploadengine/uploadify.swf',
    'script'    : 'uploadengine/uploadify.php',
    'cancelImg' : 'uploadengine/cancel.png',
    'folder'    : 'uploadengine/uploads',
	'removeCompleted' : false,
	'sizeLimit'   : 2097152,
    'auto'      : true,
	'onComplete'  : function(event, ID, fileObj, response, data) {
			$("#dialog1").dialog('close');
	    	}
	    });		
	   }	  
  });
  
  
		return false;
});

Open in new window


<div id="dialog1" title="Image Upload" style="display:none;"> </div>


im trying to integrate uploadify plugin into a uidialog everytime dialog opens uploadify content repeating. any idea how to reset after dialog close?



Thanks

0
Comment
Question by:3xtr3m3d
1 Comment
 
LVL 17

Accepted Solution

by:
Shinesh Premrajan earned 500 total points
ID: 35214108
It seems the code for this

var up = '<input id="file_upload" name="file_upload" type="file" />';
$('#dialog1').empty().html(up) ;

Is adding up repeatedly. u need to reset the HTML contents before uploading.

Hope this helps

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Open dialog with server side controls in it 3 46
How to make google charts responsive 4 46
Can't get page to reload 9 18
Jquery if else not working ... WHY? 5 23
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question