Hello, everyone...
  I've looked everywhere, and I've still have a problem with
validation (that even may be solved in another way)...
  I have two tables. Users (id, created, modified, name, login,
password) and Companies (id, created, modified, name, user_id).
  I want an ajax search to fill the user_id in my companies table. I
have tought in two ways of that:

#1
Make an ajax searchable field (the search must be with the users.name
field only), that stores the user.id somewhere to pass to the
company.user_id when submitting the form

Since I havent found a solution, for that, I skipped to another
approach

#2
In the ajax searcheable field, grab the name of the user (wich is
unique in the table), check the users table to see if the name really
exists, grab the id and move on...

BUT, I tried to make a validation (in the controller) to check if the
name really exists, and, if not, accuse an error and return the same
view again. I havent found how to tell the view that there is a
problem with the data submitted.

I am using cake version 1.2.0.5427alpha.
I have a Users model with no fancy stuff
I have a Company model with no fancy stuff
I have a Companies controller with index and add controllers.
  Index lists the companies
  Add prints the add company view if no data is passed to it. If any
data is passed to it, it SIMPLY checks if the name of the user passed
is valid (I havent even done any saving in the database yet).

If anyone can help with either the problems above, I would be VERY
MUCH grateful.

Thanks!
- LS


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

Reply via email to