开发者

"AJAX" upload an image in part of a larger form

开发者 https://www.devze.com 2023-01-30 14:11 出处:网络
I love the uploader I found at ZURB. I would like to incorporate it in to a larger form with text fields/etc, but which could be made far better by allowing for that AJAX feel.

I love the uploader I found at ZURB. I would like to incorporate it in to a larger form with text fields/etc, but which could be made far better by allowing for that AJAX feel.

The problem is, the preview appears to work by submitting the form, which I don't want to do as ther开发者_StackOverflowe will be text fields for the user to fill in as well, and those may or may not be filled in yet.

I want to make the form handler as simple as possible, without a lot of CASE or if(){}else(){} if possible, and I would prefer the whole thing to work together as one form, instead of having an image upload form and a info submission form. Is there any way I can do this? It seems like it's probably impossible without resorting to one of the two scenarios above.


You are going to have to submit the form in order to show the picture to the user, otherwise the script would be accessing local file paths, which for the most part is not allowed.

However, this does not mean that you cannot do a background submit, which is exactly what ZURB does. In fact, the page mentions its usefulness in large forms where the user wants to preview the image before submitting the form. And when I say submit here, I mean the user-initiated submit.

0

精彩评论

暂无评论...
验证码 换一张
取 消