Yes, I use $form->input()
I found an issue because I was SQL again for the specific data before
going back to the page to show user an errors.
(I had an code like this that's why I couldn't keep the entered value
when there is an error.
===============================================
function admin_edit(id = null){
if (!empty($this->data)) {
...
$this->data = $this->Customer->read(null, $id);
}
if (empty($this->data)) {
...
$this->data = $this->Customer->read(null, $id);
}
}
===============================================
I took out the line "$this->data = $this->Customer->read(null, $id);"
in "if (!empty($this->data))" statement now I can keep the entered
value when there is an error.
However, now I have an other issue.
In this admin/customers/edit page, I need to set "$this->Customer-
>recursive = 6;" to get all kind of information relates to Customer
from other table.
Either coming back with an error or success updating information(I
want to page to back to edit page not index page after "save"),
I get "Undefined index" error everywhere in this page because after
coming back to page, $this->data has only the information model show
relationship(I think,,, I have 4 "has one" relationship in this model
(Customer) and only those information is available from $this->data
after submit)
How can I get "$this->data" has "recursive = 6" data to avoid getting
"undefined index" error?
thanks,
leafchild
On Aug 7, 6:22 pm, brian <[email protected]> wrote:
> Are you using FormHelper to create your form elements? If you do, for example:
>
> echo $form->input('Post')
>
> ... the helper will add the value of the element based upon $this->data.
>
> If you are using the helper, maybe you should post your controller and
> view code.
>
>
>
> On Fri, Aug 7, 2009 at 6:56 PM,leafchild<[email protected]> wrote:
>
> > I have a page with form.
>
> > If user entered name, address,,,and ,all kinds of information and
> > submit but there is mistakes such as not entered email
> > properly and came back to form page with error message. How can I keep
> > the entered value user entered properly.
>
> > Currently in my form page, if user has an error, all the entered value
> > are gone and user has to entered everything.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---