[FX.php List] JQuery and posting image-upload forms

Bob Patin bob at patin.com
Thu Aug 18 09:12:54 MDT 2011


Well, I'm not sure what to call it, but I'm using JQuery to submit a form. I'm using actual FORM tags…

So my form has the enctype set to "multipart/form-data"; my JQuery looks like this:

 <script type="text/javascript">
$(document).ready(function(){
	// submit form
	$('#form1').submit(function() {
		
		var folder_var  = $('#folder').val();
		var filename_var = $('#filename').val();
		var userid_var = $('#userid').val();
		
		// POST the form
		$('#status').html('Uploading file...');
		$.post(
			// URL
			'upload2.php', 
			// DATA
			{
				folder: folder_var,
				filename: filename_var ,
				userid: userid_var

so… upload2.php is the page that does the uploading. I've run this page by itself, and it does process just fine, but not using this above…

Any thoughts?

thanks,

Bob
bob at patin.com





On Aug 18, 2011, at 9:03 AM, Steve Winter wrote:

> What do you mean by 'jQuery form-processing method'...? do you mean you're trying to use jQuery and AJAX to submit a form...? if that's the case, then no, it won't work...
> 
> If all you're using jQuery to do is to submit a standard form, then it should work fine...??
> 
> Cheers
> Steve
> 
>> Anyone used JQuery in conjunction with a form that uploads files?
>> 
>> I've tested the upload page and its associated processing page, and both work fine; however, when I embed the upload page with JQuery, and then try to use JQuery to trigger the form-process, it fails.
>> 
>> I'm wondering if the JQuery form-processing method will work with forms that are dealing with files?
>> 
>> Thanks for any help,
>> 
>> Bob Patin
>> Longterm Solutions LLC
>> bob at longtermsolutions.com
>> 615-333-6858
>> http://www.longtermsolutions.com
>> FileMaker 9, 10 & 11 Certified Developer
>> Member of FileMaker Business Alliance and FileMaker TechNet
>> --
>> Twitter: bobpatin
>> Google+: http://www.longtermsolutions.com/plus
>> AIM: longterm1954
>> iChat: bobpatin
>> --
>> Expert FileMaker Consulting 
>> FileMaker Hosting for all versions of FileMaker
>> 
> 



More information about the FX.php_List mailing list