Re: Loosing passed arguments after validation and redirection to show errors
I am glad it worked out. Those ajax submits can have you scratching your head a lot before you realize what is going on. On Nov 7, 2:43 am, Home Boy Howy [EMAIL PROTECTED] wrote: Ok, I am a complete dork. The reason this wasn't working is because the AJAX submit wasn't going to the ACTUAL action of the form. So getting rid of that parameter of jQuery AJAX form submit it went to the correct form action which allowed the validation process to return to the correct URL and action. Martins tip above was a great help: You could change your forma little: $form-create('Contact', array('url' = $this-here, 'id' = 'sendpage- form')) Thanks Martin!! -Brian On Nov 6, 4:47 pm, Home Boy Howy [EMAIL PROTECTED] wrote: Wow. I did what you recommends and still no love. Thank you for the tip on $this-here syntax. It is still clearing the params on validation. I guess I don't understand what happens during the validation process. I assumed that it would just return the user to the previous URL with all params still in the URL which would then just reset that data variable. What I am trying to do is a similiar thing as a basic old CakePHP generated admin edit form, but instead of passing the controller function the Id I am trying to pass the function a URL string. Just like the edit link passes the edit form the id and sets a hidden form value, I want to do this with a url string. On edit and submit of the form, instead of saving the data I want to shoot of an email to the email addresses added in the form. What is throwing me is the darn validation of this form. -Brian On Nov 6, 1:45 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Howy, You are loosing the agruments since you are submitting the form to / contacts/send_page and not /contacts/send_page/params/here. But you still try to pull sendUrl from the passed params if the validation fails. You could change your forma little: $form-create('Contact', array('url' = $this-here, 'id' = 'sendpage- form')) or not replace the value of $this-data['Contact']['sendUrl'] if the validation fails. I prefer the first alternative. Either way, you need to validate the url passed and handle that in a different way since displaying the form again will not solve that problem. This data should first be validated before even displaying the form and if the url does not pass validation the form should probably not be displayed at all. /Martin --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Loosing passed arguments after validation and redirection to show errors
Hi Howy, You are loosing the agruments since you are submitting the form to / contacts/send_page and not /contacts/send_page/params/here. But you still try to pull sendUrl from the passed params if the validation fails. You could change your forma little: $form-create('Contact', array('url' = $this-here, 'id' = 'sendpage- form')) or not replace the value of $this-data['Contact']['sendUrl'] if the validation fails. I prefer the first alternative. Either way, you need to validate the url passed and handle that in a different way since displaying the form again will not solve that problem. This data should first be validated before even displaying the form and if the url does not pass validation the form should probably not be displayed at all. /Martin --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Loosing passed arguments after validation and redirection to show errors
Wow. I did what you recommends and still no love. Thank you for the tip on $this-here syntax. It is still clearing the params on validation. I guess I don't understand what happens during the validation process. I assumed that it would just return the user to the previous URL with all params still in the URL which would then just reset that data variable. What I am trying to do is a similiar thing as a basic old CakePHP generated admin edit form, but instead of passing the controller function the Id I am trying to pass the function a URL string. Just like the edit link passes the edit form the id and sets a hidden form value, I want to do this with a url string. On edit and submit of the form, instead of saving the data I want to shoot of an email to the email addresses added in the form. What is throwing me is the darn validation of this form. -Brian On Nov 6, 1:45 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Howy, You are loosing the agruments since you are submitting the form to / contacts/send_page and not /contacts/send_page/params/here. But you still try to pull sendUrl from the passed params if the validation fails. You could change your forma little: $form-create('Contact', array('url' = $this-here, 'id' = 'sendpage- form')) or not replace the value of $this-data['Contact']['sendUrl'] if the validation fails. I prefer the first alternative. Either way, you need to validate the url passed and handle that in a different way since displaying the form again will not solve that problem. This data should first be validated before even displaying the form and if the url does not pass validation the form should probably not be displayed at all. /Martin --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Loosing passed arguments after validation and redirection to show errors
Ok, I am a complete dork. The reason this wasn't working is because the AJAX submit wasn't going to the ACTUAL action of the form. So getting rid of that parameter of jQuery AJAX form submit it went to the correct form action which allowed the validation process to return to the correct URL and action. Martins tip above was a great help: You could change your forma little: $form-create('Contact', array('url' = $this-here, 'id' = 'sendpage- form')) Thanks Martin!! -Brian On Nov 6, 4:47 pm, Home Boy Howy [EMAIL PROTECTED] wrote: Wow. I did what you recommends and still no love. Thank you for the tip on $this-here syntax. It is still clearing the params on validation. I guess I don't understand what happens during the validation process. I assumed that it would just return the user to the previous URL with all params still in the URL which would then just reset that data variable. What I am trying to do is a similiar thing as a basic old CakePHP generated admin edit form, but instead of passing the controller function the Id I am trying to pass the function a URL string. Just like the edit link passes the edit form the id and sets a hidden form value, I want to do this with a url string. On edit and submit of the form, instead of saving the data I want to shoot of an email to the email addresses added in the form. What is throwing me is the darn validation of this form. -Brian On Nov 6, 1:45 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Howy, You are loosing the agruments since you are submitting the form to / contacts/send_page and not /contacts/send_page/params/here. But you still try to pull sendUrl from the passed params if the validation fails. You could change your forma little: $form-create('Contact', array('url' = $this-here, 'id' = 'sendpage- form')) or not replace the value of $this-data['Contact']['sendUrl'] if the validation fails. I prefer the first alternative. Either way, you need to validate the url passed and handle that in a different way since displaying the form again will not solve that problem. This data should first be validated before even displaying the form and if the url does not pass validation the form should probably not be displayed at all. /Martin --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---