Changeset 7987
- Timestamp:
- 03/19/08 18:52:52 (4 months ago)
- Files:
-
- doc/branches/1.0/book/11-Ajax-Integration.txt (modified) (1 diff)
- doc/branches/1.1/book/11-Ajax-Integration.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
doc/branches/1.0/book/11-Ajax-Integration.txt
r7807 r7987 287 287 288 288 >**CAUTION** 289 >Ajax forms can't be multipart. This is a limitation of the `XMLHttpRequest` object. This means you can't handle file uploads via an Ajax form. There are workarounds though--for instance, using a hidden `iframe` instead of an `XMLHttpRequest` (see an implementation at [http://www.air4web.com/files/upload/](http://www.air4web.com/files/upload/)).289 >Ajax forms can't be multipart. This is a limitation of the `XMLHttpRequest` object. This means you can't handle file uploads via an Ajax form. There are workarounds though--for instance, using a hidden `iframe` instead of an `XMLHttpRequest`. 290 290 291 291 If you want to allow a form to work in both page mode and Ajax mode, the best solution is to define it like a regular form, but to provide, in addition to the normal submit button, a second button (`<input type="button" />`) to submit the form in Ajax. Symfony calls this button `submit_to_remote()`. This will help you build Ajax interactions that degrade gracefully. See an example in Listing 11-12. doc/branches/1.1/book/11-Ajax-Integration.txt
r7855 r7987 297 297 298 298 >**CAUTION** 299 >Ajax forms can't be multipart. This is a limitation of the `XMLHttpRequest` object. This means you can't handle file uploads via an Ajax form. There are workarounds though--for instance, using a hidden `iframe` instead of an `XMLHttpRequest` (see an implementation at [http://www.air4web.com/files/upload/](http://www.air4web.com/files/upload/)).299 >Ajax forms can't be multipart. This is a limitation of the `XMLHttpRequest` object. This means you can't handle file uploads via an Ajax form. There are workarounds though--for instance, using a hidden `iframe` instead of an `XMLHttpRequest`. 300 300 301 301 If you want to allow a form to work in both page mode and Ajax mode, the best solution is to define it like a regular form, but to provide, in addition to the normal submit button, a second button (`<input type="button" />`) to submit the form in Ajax. Symfony calls this button `submit_to_remote()`. This will help you build Ajax interactions that degrade gracefully. See an example in Listing 11-12.