Re: passing form data to my controller
thx dave...i appreaciate your help :) i switched to a 100% Jquery and made it work somehowi needed to initialize JQuery again, as soon as I reloaded a div...thats why it did not work and i had to try the ajax thinganyway... thank you On 14 Sep., 17:08, "Dave Maharaj" wrote: > Ok if I am reading this right you would need 2 actions no? > > Say > upload() { > autoRender = false; > //show nothing > //form has been submitted > This->data do what you need to do to get the info size, type > $myFormData = array(); > //push the data you get from the form into the array > > $this->Model->__useMyDataFunction($myFormData); > > } > > function __useMyDataFunction($myFormData){ > > //process the data how ever you need it and then render the view with all > that you need > > } > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: September-14-10 5:43 AM > To: CakePHP > Subject: Re: passing form data to my controller > > well i have a form with the type FILE. a user can upload files and the > data (filename, size, type etc) should be passed to a function in my > controller. this controller function is acutally doing the logic, > means saving or uploading the file. then this function is rendering a > view showing all files uploded... > > but now i cant pass the form data with AJAX..it is the only thing > missing... > > thank you :) > > On 13 Sep., 17:44, "Dave Maharaj" wrote: > > I try:) > > > I missed your earlier posts so explain to me what your trying to do > exactly? > > Form submit->data to controller-> display what was submitted on the same > > page your on? > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: September-13-10 1:04 PM > > To: CakePHP > > Subject: Re: passing form data to my controller > > > dave...you have no idea how your torturing me. seriously. I am trying > > to figure this out for 2 weeks now and its makin me crazy...i've never > > been closer to givng up > > > i will look into your hint, but do you mind helping me with a little > > code or specifics? > > > thx a LOT > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: passing form data to my controller
Ok if I am reading this right you would need 2 actions no? Say upload() { autoRender = false; //show nothing //form has been submitted This->data do what you need to do to get the info size, type $myFormData = array(); //push the data you get from the form into the array $this->Model->__useMyDataFunction($myFormData); } function __useMyDataFunction($myFormData){ //process the data how ever you need it and then render the view with all that you need } -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: September-14-10 5:43 AM To: CakePHP Subject: Re: passing form data to my controller well i have a form with the type FILE. a user can upload files and the data (filename, size, type etc) should be passed to a function in my controller. this controller function is acutally doing the logic, means saving or uploading the file. then this function is rendering a view showing all files uploded... but now i cant pass the form data with AJAX..it is the only thing missing... thank you :) On 13 Sep., 17:44, "Dave Maharaj" wrote: > I try:) > > I missed your earlier posts so explain to me what your trying to do exactly? > Form submit->data to controller-> display what was submitted on the same > page your on? > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: September-13-10 1:04 PM > To: CakePHP > Subject: Re: passing form data to my controller > > dave...you have no idea how your torturing me. seriously. I am trying > to figure this out for 2 weeks now and its makin me crazy...i've never > been closer to givng up > > i will look into your hint, but do you mind helping me with a little > code or specifics? > > thx a LOT Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: passing form data to my controller
i think the problem here is that I have a file upload involved and not just usual datai dont think there is any other way than JQuery..right? On 14 Sep., 10:12, Tomfox Wiranata wrote: > well i have a form with the type FILE. a user can upload files and the > data (filename, size, type etc) should be passed to a function in my > controller. this controller function is acutally doing the logic, > means saving or uploading the file. then this function is rendering a > view showing all files uploded... > > but now i cant pass the form data with AJAX..it is the only thing > missing... > > thank you :) > > On 13 Sep., 17:44, "Dave Maharaj" wrote: > > > I try:) > > > I missed your earlier posts so explain to me what your trying to do exactly? > > Form submit->data to controller-> display what was submitted on the same > > page your on? > > > -Original Message- > > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > > Sent: September-13-10 1:04 PM > > To: CakePHP > > Subject: Re: passing form data to my controller > > > dave...you have no idea how your torturing me. seriously. I am trying > > to figure this out for 2 weeks now and its makin me crazy...i've never > > been closer to givng up > > > i will look into your hint, but do you mind helping me with a little > > code or specifics? > > > thx a LOT Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: passing form data to my controller
well i have a form with the type FILE. a user can upload files and the data (filename, size, type etc) should be passed to a function in my controller. this controller function is acutally doing the logic, means saving or uploading the file. then this function is rendering a view showing all files uploded... but now i cant pass the form data with AJAX..it is the only thing missing... thank you :) On 13 Sep., 17:44, "Dave Maharaj" wrote: > I try:) > > I missed your earlier posts so explain to me what your trying to do exactly? > Form submit->data to controller-> display what was submitted on the same > page your on? > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: September-13-10 1:04 PM > To: CakePHP > Subject: Re: passing form data to my controller > > dave...you have no idea how your torturing me. seriously. I am trying > to figure this out for 2 weeks now and its makin me crazy...i've never > been closer to givng up > > i will look into your hint, but do you mind helping me with a little > code or specifics? > > thx a LOT Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: passing form data to my controller
I try:) I missed your earlier posts so explain to me what your trying to do exactly? Form submit->data to controller-> display what was submitted on the same page your on? -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: September-13-10 1:04 PM To: CakePHP Subject: Re: passing form data to my controller dave...you have no idea how your torturing me. seriously. I am trying to figure this out for 2 weeks now and its makin me crazy...i've never been closer to givng up i will look into your hint, but do you mind helping me with a little code or specifics? thx a LOT Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: passing form data to my controller
dave...you have no idea how your torturing me. seriously. I am trying to figure this out for 2 weeks now and its makin me crazy...i've never been closer to givng up i will look into your hint, but do you mind helping me with a little code or specifics? thx a LOT On 13 Sep., 15:44, "Dave Maharaj" wrote: > Well when you type in a field and you check say the username field in real > time using ajax to make sure it is unique your sending form data to the > controller. Sometimes you just have to figure it out on your own and forget > the helpers. Trust me it can be done to pass the form data to the > controller when you "submit a form using ajax" <-hint google it > > -Original Message- > From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] > Sent: September-13-10 5:56 AM > To: CakePHP > Subject: Re: passing form data to my controller > > well I used jquery before to just reload that DIV after a file got > uploaded and it worked fine. In the end I just needed to render the > result. > but when I added an ajax link in that rendered view to delete a file, > It didnt work. AJAX just would not work. as soon as I abandoned jquery > and just used AJAX->link it worked and I just had to make the file > upload work with AJAX too. > > this seems hopeless.?? > > On 13 Sep., 10:15, Tomfox Wiranata wrote: > > so there is no way to pass the file data from my form to my controller > > function??? > > because the controller function actually uploads the file, it just > > needs the data > > > that would suck... > > > On 13 Sep., 02:00, cricket wrote: > > > > Files cannot be upload with AJAX. The only way to do it without > > > reloading the page is to set the target of the form to a hidden > > > iframe, then fetch the response from there. > > > > On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata > > > > wrote: > > > > Hi everyone, > > > > > I use a form to upload files and currently i do this with jquery to > > > > simulate ajax, so if I want to pass the file data to my jquery > > > > function I do this: > > > > > > > > type="button">Upload > > > > > But I want to switch to AJAX and I dont know how to pass the form data > > > > within an ajax link: > > > > > echo $form->create('Links', > > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=> > 'file')); > > > > echo $form->file('Links'); > > > > > echo $ajax->link('Upload', '/links/processattachment'.this.form, > > > > array('update' => > 'attachments_content') > > > > ); > > > > echo $form->end(); > > > > > aware that "$ajax->link('Upload', '/links/ > > > > processattachment'.this.form," is far away from right I stil gave it a > > > > shot. > > > > > Can someone help me? Thank you. I appreciate it. > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp > others with their CakePHP related questions. > > > > > You received this message because you are subscribed to the Google > Groups "CakePHP" group. > > > > To post to this group, send email to cake-php@googlegroups.com > > > > To unsubscribe from this group, send email to > > > > cake-php+unsubscr...@googlegroups.com For more options, visit this > group athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
RE: passing form data to my controller
Well when you type in a field and you check say the username field in real time using ajax to make sure it is unique your sending form data to the controller. Sometimes you just have to figure it out on your own and forget the helpers. Trust me it can be done to pass the form data to the controller when you "submit a form using ajax" <-hint google it -Original Message- From: Tomfox Wiranata [mailto:tomfox.wiran...@gmail.com] Sent: September-13-10 5:56 AM To: CakePHP Subject: Re: passing form data to my controller well I used jquery before to just reload that DIV after a file got uploaded and it worked fine. In the end I just needed to render the result. but when I added an ajax link in that rendered view to delete a file, It didnt work. AJAX just would not work. as soon as I abandoned jquery and just used AJAX->link it worked and I just had to make the file upload work with AJAX too. this seems hopeless.?? On 13 Sep., 10:15, Tomfox Wiranata wrote: > so there is no way to pass the file data from my form to my controller > function??? > because the controller function actually uploads the file, it just > needs the data > > that would suck... > > On 13 Sep., 02:00, cricket wrote: > > > Files cannot be upload with AJAX. The only way to do it without > > reloading the page is to set the target of the form to a hidden > > iframe, then fetch the response from there. > > > On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata > > > wrote: > > > Hi everyone, > > > > I use a form to upload files and currently i do this with jquery to > > > simulate ajax, so if I want to pass the file data to my jquery > > > function I do this: > > > > > > type="button">Upload > > > > But I want to switch to AJAX and I dont know how to pass the form data > > > within an ajax link: > > > > echo $form->create('Links', > > > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=> 'file')); > > > echo $form->file('Links'); > > > > echo $ajax->link('Upload', '/links/processattachment'.this.form, > > > array('update' => 'attachments_content') > > > ); > > > echo $form->end(); > > > > aware that "$ajax->link('Upload', '/links/ > > > processattachment'.this.form," is far away from right I stil gave it a > > > shot. > > > > Can someone help me? Thank you. I appreciate it. > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups "CakePHP" group. > > > To post to this group, send email to cake-php@googlegroups.com > > > To unsubscribe from this group, send email to > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: passing form data to my controller
well I used jquery before to just reload that DIV after a file got uploaded and it worked fine. In the end I just needed to render the result. but when I added an ajax link in that rendered view to delete a file, It didnt work. AJAX just would not work. as soon as I abandoned jquery and just used AJAX->link it worked and I just had to make the file upload work with AJAX too. this seems hopeless.?? On 13 Sep., 10:15, Tomfox Wiranata wrote: > so there is no way to pass the file data from my form to my controller > function??? > because the controller function actually uploads the file, it just > needs the data > > that would suck... > > On 13 Sep., 02:00, cricket wrote: > > > Files cannot be upload with AJAX. The only way to do it without > > reloading the page is to set the target of the form to a hidden > > iframe, then fetch the response from there. > > > On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata > > > wrote: > > > Hi everyone, > > > > I use a form to upload files and currently i do this with jquery to > > > simulate ajax, so if I want to pass the file data to my jquery > > > function I do this: > > > > > > type="button">Upload > > > > But I want to switch to AJAX and I dont know how to pass the form data > > > within an ajax link: > > > > echo $form->create('Links', > > > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file')); > > > echo $form->file('Links'); > > > > echo $ajax->link('Upload', '/links/processattachment'.this.form, > > > array('update' => 'attachments_content') > > > ); > > > echo $form->end(); > > > > aware that "$ajax->link('Upload', '/links/ > > > processattachment'.this.form," is far away from right I stil gave it a > > > shot. > > > > Can someone help me? Thank you. I appreciate it. > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > > > "CakePHP" group. > > > To post to this group, send email to cake-php@googlegroups.com > > > To unsubscribe from this group, send email to > > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: passing form data to my controller
so there is no way to pass the file data from my form to my controller function??? because the controller function actually uploads the file, it just needs the data that would suck... On 13 Sep., 02:00, cricket wrote: > Files cannot be upload with AJAX. The only way to do it without > reloading the page is to set the target of the form to a hidden > iframe, then fetch the response from there. > > On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata > > wrote: > > Hi everyone, > > > I use a form to upload files and currently i do this with jquery to > > simulate ajax, so if I want to pass the file data to my jquery > > function I do this: > > > > type="button">Upload > > > But I want to switch to AJAX and I dont know how to pass the form data > > within an ajax link: > > > echo $form->create('Links', > > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file')); > > echo $form->file('Links'); > > > echo $ajax->link('Upload', '/links/processattachment'.this.form, > > array('update' => 'attachments_content') > > ); > > echo $form->end(); > > > aware that "$ajax->link('Upload', '/links/ > > processattachment'.this.form," is far away from right I stil gave it a > > shot. > > > Can someone help me? Thank you. I appreciate it. > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to cake-php@googlegroups.com > > To unsubscribe from this group, send email to > > cake-php+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: passing form data to my controller
Files cannot be upload with AJAX. The only way to do it without reloading the page is to set the target of the form to a hidden iframe, then fetch the response from there. On Sun, Sep 12, 2010 at 11:26 AM, Tomfox Wiranata wrote: > Hi everyone, > > I use a form to upload files and currently i do this with jquery to > simulate ajax, so if I want to pass the file data to my jquery > function I do this: > > type="button">Upload > > > But I want to switch to AJAX and I dont know how to pass the form data > within an ajax link: > > echo $form->create('Links', > array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file')); > echo $form->file('Links'); > > echo $ajax->link('Upload', '/links/processattachment'.this.form, > array('update' => 'attachments_content') > ); > echo $form->end(); > > > aware that "$ajax->link('Upload', '/links/ > processattachment'.this.form," is far away from right I stil gave it a > shot. > > Can someone help me? Thank you. I appreciate it. > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to cake-php@googlegroups.com > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
passing form data to my controller
Hi everyone, I use a form to upload files and currently i do this with jquery to simulate ajax, so if I want to pass the file data to my jquery function I do this: Upload But I want to switch to AJAX and I dont know how to pass the form data within an ajax link: echo $form->create('Links', array('name'=>'uploadAttachmentsForm','id'=>'uploadAttachmentsForm','type'=>'file')); echo $form->file('Links'); echo $ajax->link('Upload', '/links/processattachment'.this.form, array('update' => 'attachments_content') ); echo $form->end(); aware that "$ajax->link('Upload', '/links/ processattachment'.this.form," is far away from right I stil gave it a shot. Can someone help me? Thank you. I appreciate it. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en