(Jul 9, 2012 08:05 AM)D Double E Wrote: I have looked online and everyone does it differently. Whats the simplest way to submit a form that only has one input (file) to a external php script then echo out the response in a span with a id of "response"
P.S
Is submitting a image different then submitting a text field in jquery/ajax?
No, a image isn't that different then any other input just the data that is sent is different.
It depends on you plan on doing this? is it a static form or dynamic?
you want to do this via ajax? if you do then you can't send images via ajax if you plan for dynamic workflow or upload more then 1 image at a time.
You will need to use a iframe and embed a php file to it. then direct the form post to that iframe using the target attribute. There're many ways to do this.
Do explain if you want to submit an image via ajax? and if you want to do it dynamically. Meaning when you submit the form it dosen't redirect you to that website where you posted the data too. Instead you want like a div to fade in and say you succeeded on submitting a image. Then fade out.
If you want that effect you have to use an iframe to have that php file on that iframe. then use the target attribute. Use that method and it should work. It's not actually using ajax but gives you that ajax effect. You then submit the values to that php file.
It's a little bypass trick.
