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

Steve Winter steve at bluecrocodile.co.nz
Thu Aug 18 09:24:44 MDT 2011


Hi Bob

Then that is using Ajax, and no, that won't work as written because you're not actually posting the form itself, you're building an array of values which you are then posting...

What you could try, instead of doing $.post(... as you do below, is actually then do a 'return true' which should then actually submit the form...

Is there some reason why you want to do this with Ajax, rather than just submitting the form....?

Cheers
Steve

> 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
>>> 
>> 
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

Steve Winter
+44 777 852 4776
steve at bluecrocodile.co.nz



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20110818/cb75d57a/attachment.html


More information about the FX.php_List mailing list