Joomla! Discussion Forums



It is currently Tue Nov 24, 2009 1:56 pm (All times are UTC )

 




Post new topic Reply to topic  [ 13 posts ] 
Author Message
Posted: Sat Oct 03, 2009 12:32 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Feb 18, 2008 9:50 am
Posts: 17
Hi all,

i'm looking for 2 weeks a way to implement a form into my component. I'm using the MVC standards and everything works well. But (there is always a but) .
I have a form with an input text and an input file, in order to upload an image. I would like to introduce an ajax upload. The goal is to upload the file without refreshing the page, and when finished, show a thumbnail into a div. Then, submit the form, which will contain the input text and the filename, and finaly store the POST into a database and move the file from the temp directory to the right one.
I have found some standalone php/ajax scripts but i don't find how to modify to adapt for the MVC.
I have found some posts into this forum and a tuto around ajax for refreshing listbox. But i don't find something that could really helpt me.

Do you have an example or a good idea how to do it ?

thanks a lot for your help


Top
  E-mail  
 
Posted: Sat Oct 03, 2009 1:13 pm 
User avatar
Joomla! Ace
Joomla! Ace
Offline

Joined: Thu Feb 15, 2007 5:48 am
Posts: 1462
Location: Sydney, Australia
jQuery may be the answer, based on a couple of available options:
http://www.phpletter.com/Demo/AjaxFileUpload-Demo/
http://www.phpletter.com/Our-Projects/AjaxFileUpload/
If you are wondering how to include jQuery in your template, there is an extension SC jQuery which you can download from http://extensions.joomla.org/extensions/core-enhancements/scripts/7230.
I have used a different method, described in detail in this thread: http://forum.joomla.org/viewtopic.php?f=428&t=444671

_________________
Toivo
Sydney, Australia


Top
  E-mail  
 
Posted: Sat Oct 03, 2009 1:48 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Feb 18, 2008 9:50 am
Posts: 17
Thanks for your help, but i'm a little bit confused. This script doesn't put the file into a div or whatever to display the image after loading.
And, i'm a kind of newbie and don't know really where to implement the php that does the upload. In the controler ?
The example you give to me is to far from my need. no refresh of the current page, no idea how to post the form for the other fields + the path and filenamed just uploaded.

But again, even if my question keeps alive, thank you.


Top
  E-mail  
 
Posted: Sat Oct 03, 2009 2:03 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Sep 09, 2005 2:13 pm
Posts: 6737
Location: The Netherlands
Why do you use AJAX if you can do it in a normal form also?
After you have it working you can change it a bit to AJAX, the AJAX techniques are not easy to learn if you don;t have these skills..

I'm also learning AJAX at the moment... :S

_________________
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards


Top
  E-mail  
 
Posted: Sat Oct 03, 2009 2:43 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Feb 18, 2008 9:50 am
Posts: 17
i know how to implement a form including a upload file , if the form is submited with a standard post (trought a sbmit).
But, what i would like to do is to offer the user, a thumbnail of the image he chose, before submitting.
Perhaps, it is not an ajax feature, but it seems it is...


Top
  E-mail  
 
Posted: Sun Oct 04, 2009 2:56 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Sep 09, 2005 2:13 pm
Posts: 6737
Location: The Netherlands
Do not bump your topics please. It's against the forum rules.

_________________
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards


Top
  E-mail  
 
Posted: Mon Oct 05, 2009 9:14 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Feb 18, 2008 9:50 am
Posts: 17
hi again,

i'm surprise that nobody has already done this job, and that nobody is interrested in.... is it the case ?


Top
  E-mail  
 
Posted: Tue Oct 06, 2009 11:57 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Sep 09, 2005 2:13 pm
Posts: 6737
Location: The Netherlands
I am very interrested, but don't have an answer for you.
Next week I will get my first AJAX lessons, so maybe I can tell you later on.

_________________
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards


Top
  E-mail  
 
Posted: Wed Oct 07, 2009 6:04 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Feb 18, 2008 9:50 am
Posts: 17
ok, i continue trying to solve the problem. Are you getting real lessons or are you your own teacher ? ;)


Top
  E-mail  
 
Posted: Wed Oct 07, 2009 10:44 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Sep 09, 2005 2:13 pm
Posts: 6737
Location: The Netherlands
I will become a certified AJAX programmer. (I am all ready a certified PHP programmer) AJAX is just cool, so I want to know the technique :D

_________________
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards


Top
  E-mail  
 
Posted: Tue Oct 13, 2009 9:12 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Mon Feb 18, 2008 9:50 am
Posts: 17
i has been difficult to manage js , php and where to put it into the layout, controller and view. is it possible by using a iframe. I don't know if it is the best way, but it works.


Top
  E-mail  
 
Posted: Tue Oct 13, 2009 11:27 pm 
User avatar
Joomla! Guru
Joomla! Guru
Offline

Joined: Mon Oct 09, 2006 9:52 pm
Posts: 999
Location: Tampa Floriduh - The jewels of America's wang!
I have used ExtJS and J! with astounding results. Its for experienced programmers, but if you are up to it, take a look at

http://www.extjs.com/deploy/dev/examples/samples.html

_________________
http://www.joomflix.com - Movies, music, games, and books for your website also Kiva Micro Lending and Amazon Mechanical Turk Crowdsourcing website analysis


Top
   
 
Posted: Wed Oct 14, 2009 11:39 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Sep 09, 2005 2:13 pm
Posts: 6737
Location: The Netherlands
Yes I am also learning ExtJS as library. So hope to get it working in J! also.

_________________
Robert Dam - Joomla Forum Moderator
Dutch Boards | Joomla Coding Boards | English Support Boards


Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

Quick reply

 



Who is online

Users browsing this forum: MeeDNite, ooffick and 41 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group