6 answers
2 votes
What do you think of my Validation tool?
I got frustrated with long complicated validation rules in my models, and the limited functionality of Bake's validation generation, so I made my own tool. If I get enough support I will clean it up, make it pretty, and probably get it its own...
2 answers
1 vote
"Bake" validations differences between Name and Title fields
I don't know if any of you have already noticed this, but when we're baking a model in the Cake Bake console, there is a subtle differences for default validations between fields named "name" and "title":
name : the default selected validation...
3 answers
-2 votes
Validation: Difference between allowEmpty flag and notEmpty rule
I was reading the Cookbook tonight and I noticed that there are comparisons for the "required" flag and "notEmpty" rule, and the "allowEmpty" flag and the "required" flag...
But no comparison for the "allowEmpty" flag and "notEmpty" rule.
So the...
2 answers
0 votes
Validation Rules: between and minLength != required?
While following some of the beginner tutorials, and playing around with CakePHP, I noticed that on the CRUD pages generated from the Cake console, the Create page would list many fields as bold, and many as normal text. A Google search told me,...
2 answers
0 votes
Display form field specific validation errorsspecific
I can get the form validation errors to work with a form that validates against 1 model.
But now I have a mixed form and validate against multiple models.
The field specific errors don't show anymore, but luckily I can catch the field erros using...
1 answer
0 votes
Validation summary
Hi guys,
I know that if I use $form-input(), the validation errors will be shown automatically. This is really neato, but at this moment, I need a different behavior. I want those validation errors shown like a validation summary on top of the...
1 answer
0 votes
How to validate HABTM model with extra fields?
My case is: Order HABTM Product. In joining table orders_products I've extra field - quantity.
Now, when editing Order I can add Products and enter quantitiy. Here is what I've done already:
In model Order:
public $hasAndBelongsToMany =... 3 answers
0 votes
Is select box validation possible?
I have a standard form setup which includes a $form-select select box.
My validation rules are setup so that the select box mustn't be empty.
If I leave the select box empty and try to submit the form it wont because the validation rule is stopping...
1 answer
0 votes
How do i pass validation message from model to controller?
How do i pass validation message from model to controller?
2 answers
0 votes
Dynamic Validation Text
I'm using a custom function to perform validation of a date. Inside that function I have about 4 different things I'm validating on.
Is it possible to get a custom message displayed based on where it fails validation in that function.
I tried...
1 answer
0 votes
Correct data format for "required" validation flag
Hi all,
I have been reading posts on the confusion over "required" flag and I think I understand it pretty well.
However I am having problem trying to make it work.
For example, here is my...
1 answer
0 votes
How to display Variable in Error Messages during Data Validation?
Hi,
Anyone know how to display Variable in Error Messages during Data Validation?
for example, for the code below in MODEL
var $validate = array(
'login' => array(
'rule' => 'alphaNumeric',
'message' => 'Usernames must only... 1 answer
0 votes
How to validate Forms, if some fields need to be null
Hey folks,
I'm really new to CakePHP, and I must say I love it.
But now I got my first problem, and I can't find a solution at the moment.
I've got a little sytem set up, with admin routes, acl, auth and so on.
Now I want that if somebody wants to...
1 answer
0 votes
using a variable in custom validation rule
I am trying to validate that a certain title is not already used by another child of the parent that i am trying to add a new child to.
So i will need to get the parent_id from the form and then use it in the custom validation rule.
But it seems...
2 answers
0 votes
Validation problem when other validation-rules interfere
important: the following problem don't occurs when i try to edit the field for the first time. it only appears, when other validation rules come into action and stop the validation/edit-end.
Hello,
i have a field "inventory_number". This field is...
1 answer
0 votes
Validation rule for MAC addresses?
Hello,
is there any ready-made rule to validate MAC addresses?
Greetings.
1 answer
0 votes
Complex find query
I have been scratching my head on how to do this for a few days now. Lets say the user enters a date in a form and submits it.. the date is 10/2/10 for example. The database is setup to have a 'checkin' and 'checkout' date fields already...
1 answer
0 votes
How to check the validness of a foreign-key (must contained in primary-key list)?
Hello,
when i add a new data-row, in some times i have to enter a foreign-key-id. How can i check, that this entered value is valid (= is known in the linked table with the primary key)?
Can i check it with the core validation rules? The...
2 answers
0 votes
How to validate two UNIQUE fields together? (solution at the top)
Solution:
google groups linkHello,
my table rooms contains three fields: id, building_id and room.
Building_id and room have to be UNIQUE together, because room 9 is in building 1 only one time but room 9 can also conained in building 2.
The...
3 answers
0 votes
how is the 'required' class added to a input field?
Have created a form but the only 2 fields that are appearing with the class 'required' added to the div are the ones that are used for my Auth component. Other fields I have look like this but when rendered, <div class="input text" is being...