Hello. I'm new to the Cake PHP framework but have been using PHP for
years. I'm having trouble understanding the behavior of my app after
data validation. Here's the set up:

I have a 'questions_controller' that simply pulls up a dozen questions
from a database. These questions are displayed in a view (index.thml)
within a form with true & false radio buttons. No problem here, works
as expected.

When the user answers T/F to each of the questions and hits the submit
button, the form action is '/surveys/save/'. In the
'surveys_controller', I have a save() function that validates the
radio buttons to make sure every question is answered. Again, no
problems: If I answer every question, the data is saved to the surveys
table and the 'Thank you for completing the survey' messaged is
displayed via the flash function.

The problem I'm having is that if I skip a question on the form, the
form validation catches this as it should, BUT I'm taken to the '/
surveys/save' view. What I want to have displayed to the user is the
'views/questions/index.thml' page, the form, with the appropriate
error message. How do I make the save function in the
surveys_controller display a view other than 'views/surveys/
save.thml'? Am I missing something fundamental here? Any tips, code
example, or pointers to something in the documentation would be
great.

Thanks in advance,  -Chris


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to