Hi Jose,
for example
Form->input('courses', ['type'=>'select',
'multiple'=>true, 'options'=>$courses, 'label'=>false, 'div'=>false,
'autocomplete'=>'off', 'class'=>'form-control']); ?>
user may select 1 or many courses.
On Friday, February 27, 2015 at 7:12:20 PM UTC+5:30, José Lorenzo wrote:
What field are you trying to validate?
On Friday, February 27, 2015 at 2:02:00 PM UTC+1, Cake Developer wrote:
>
> I see cakephp 3.0 has same multiple select validation but I am getting
> error Array to string conversion
>
> here is what I tried
>
> ->notEmpty('input_field', __('Please select opt
I see cakephp 3.0 has same multiple select validation but I am getting
error Array to string conversion
here is what I tried
->notEmpty('input_field', __('Please select option(s)'))
->add('input_field', [
'multiple'=>[
'rule'=>['multiple', ['min'=>1]],
'message'=>'Please select option'
]
])
O
s of the fields
…… and so on
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of
Stephen S
Sent: Thursday, May 22, 2014 4:56 PM
To: cake-php@googlegroups.com
Subject: Re: Validate Dynamic Forms
You can add and remove validation rules on the fly before you check
You can add and remove validation rules on the fly before you check if the
form is valid.
http://book.cakephp.org/2.0/en/models/data-validation.html#dynamically-change-validation-rules
On 22 May 2014 19:50, Advantage+ wrote:
> I am building a questionnaire where the user can add questions to a
Thanks for your reply,
exactly, it is a query that has to be performed during the validation, in
order to check the validity of data entry.
My mistake, the query must be simple BETWEEN
Dana utorak, 19. studenoga 2013. 11:03:06 UTC+1, korisnik Benjamin Chéré
napisao je:
>
> Hello,
> I think it'
Hello,
I think it's not a validation rule, your query is a search condition
$this->Publisher->find ('all', array(
'fields' => array('pub_name', 'country', 'pub_city', 'estd'),
'conditions' => array('OR'=>array('YEAR(estd) <' => 2010, 'YEAR(estd) >' =>
2013))
));
Le lundi 18 novembre 2013 23
Right.
My bad. Good looking out!
Thanks guys J
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of André Luis
Sent: Friday, May 10, 2013 8:53 AM
To: cake-php@googlegroups.com
Subject: Re: Validate Question
It´s not a rule model have no access to components
It´s not a rule model have no access to components, you can get it on any
method inside any model using AuthComponent::user('user_id'), that´s why
some components have some static method, an example of this is when you
create a user and need to hash the password before it saves...
on model User
Create a variable in model
for e.g. in User model
var $auth;
and set this variable value from controller's beforeFilter function
$this->User->auth = $this->Session->read('Auth');
now you can access user id in User model this way
$userId =0;
if(!empty($this->auth['User']['id'])) {
$userId =$t
thanks chetan,... ! it works ...! no empty spots,...
On Thursday, November 1, 2012 10:04:38 AM UTC-7, chetan varshney wrote:
>
> use like this
>
> echo $this->Form->input("gender" , array('type' => 'select',
> 'options'=>$genders))?>
>
> good luck all set
>
> On Thu, Nov 1, 2012 at 10:16 PM, Ch
use like this
echo $this->Form->input("gender" , array('type' => 'select',
'options'=>$genders))?>
good luck all set
On Thu, Nov 1, 2012 at 10:16 PM, Chris wrote:
> thanks chetan,... I have tried that too,... no luck,... steel having empty
> spots on top of options,... please take a look of i
thanks chetan,... I have tried that too,... no luck,... steel having empty
spots on top of options,... please take a look of it,...
http://www.hamayk.com/signup
I have remove 'unknown'
On Thursday, November 1, 2012 5:47:04 AM UTC-7, chetan varshney wrote:
>
> The logic you are trying to use
hi jsundquist,...
in fact I'm getting an 2 empty spots on top with no options empty,... what
if the new user who's trying to signup accidentally deselect it ? ,... and
there we need the red wrapping warning with message,... 'message' =>
'Gender must be valid',... anyway,... for now I'm validat
The logic you are trying to use it produce html as-
unknown
male
female
So you should use in following way-
Configure::write('User.genders', array(''=>'unknown', '1'=>'male',
'2'=>'female'));
rest code is same
On Thu, Nov 1, 2012 at 3:53 PM, Chris wrote:
>
> hi guys,... I'm using cake 1.3
A select dropdown will never be empty unless one of the options is an empty
string.
- Jon
On Nov 1, 2012 5:23 AM, "Chris" wrote:
>
> hi guys,... I'm using cake 1.3
> how can I validate "select" field from Model,?
>
> what I have in bootstrap:
> Configure::write('User.genders', array('unknow
- Jon
On Nov 1, 2012 5:23 AM, "Chris" wrote:
>
> hi guys,... I'm using cake 1.3
> how can I validate "select" field from Model,?
>
> what I have in bootstrap:
> Configure::write('User.genders', array('unknown', 'male', 'female'));
>
> in a view:
>
>
> $genders = array(Configu
You'll have to assign the validation rule upon model construction. Use the
__construct function on the model to add that specific validation rule and
you should be good.
-jeremy
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Ques
var $validate = array(
'end_date' => array(
'comparison' => array('rule'=>array('field_comparison', '>',
'start_date'), 'allowEmpty'=>true),
),
);
function field_comparison($check1, $operator, $field2) {
foreach($check1 as $key=>$value1) {
You can also create the folders and make the writable before hand,
that way the file will always upload.
On Apr 28, 12:55 pm, cricket wrote:
> On Thu, Apr 28, 2011 at 2:17 PM, func0der wrote:
> > Can you explain that a bit more precise.
>
> http://php.net/manual/en/function.is-dir.phphttp://www.
On Thu, Apr 28, 2011 at 2:17 PM, func0der wrote:
> Can you explain that a bit more precise.
http://php.net/manual/en/function.is-dir.php
http://www.php.net/manual/en/function.is-writable.php
I usually handle uploads on the controller/component side. Save your
model record, get the new ID, save t
Can you explain that a bit more precise.
On Apr 28, 7:59 pm, Miles J wrote:
> Why don't you just validate that the destination folder exists and is
> writable?
>
> On Apr 28, 2:57 am, func0der wrote:
>
>
>
>
>
>
>
> > Okay.
>
> > I'm doing it like this.
>
> > I'm havin a new file uploaded.
> > T
Why don't you just validate that the destination folder exists and is
writable?
On Apr 28, 2:57 am, func0der wrote:
> Okay.
>
> I'm doing it like this.
>
> I'm havin a new file uploaded.
> The file data, like mime type, name etc. will be saved in the db under
> the file id.
> I'm using that id as
Okay.
I'm doing it like this.
I'm havin a new file uploaded.
The file data, like mime type, name etc. will be saved in the db under
the file id.
I'm using that id as a filename for the files in my filesystem.
So i need to first create a db record to use the id.
Afterwards i'm trying to save the
but thats awfully wrong and dangerous
your primary validation should be in php (in the model)
js validation is just a nice little addon
On 28 Apr., 04:15, cake-learner wrote:
> I always do validation with Jquery plugins not with cakephp function
> since the form function is limited.
--
Our newe
I always do validation with Jquery plugins not with cakephp function
since the form function is limited.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP relate
You dont need to use validates(), just set an error manually.
$this->invalidate('fields', 'Error message.');
Also, your approach is still wrong IMO. You should be doing all error
checking before any save functionality is triggered. In what scenario
will the image NOT copy/transfer? I have yet to
okay...i think i got it.
It is part of the MVC pattern, isn't it?
The model is NOT connected to the view or the helpers. These two are
getting their data or the invalid error messages by the controller.
Am i right here?
On 27 Apr., 21:00, func0der wrote:
> I can re-save and delete, so why i sh
I can re-save and delete, so why i shouldn't be able to revalidate?
The error message is also in the "validationErrors" variable but while
the output of the form there is no error message.
But why?
On 27 Apr., 20:38, Miles J wrote:
> You can't validates() something after the model save has alrea
You can't validates() something after the model save has already
happened. Use a behavior for validation or use my plugin.
https://github.com/milesj/cake-uploader
And an example model on how to use it.
https://github.com/milesj/cake-uploader/blob/master/tests/models/upload.php
On Apr 27, 11:18
, April 05, 2011 2:05 AM
To: CakePHP
Subject: Re: Validate HABTM Multiple
Are you using the 'with' key in the model relationship? Are you doing
it in both directions? I don't know if it will help but I vaguely
remember something along these lines.
On Apr 3, 11:41 am, "Krissy Master
Not some.
>
> K
>
>
>
>
>
>
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
> Of euromark
> Sent: Sunday, April 03, 2011 9:07 AM
> To: CakePHP
> Subject: Re: Validate HABTM Multiple
>
>
@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of euromark
Sent: Sunday, April 03, 2011 9:07 AM
To: CakePHP
Subject: Re: Validate HABTM Multiple
"but I never get any validation errors for the HABTM model "
what does $this->Post->saveAll() return?
boolean or array?
pr()
at is) if it validates.
>
> Not being an ass but that sounds like saveSome() if your validating it
> first.no?
>
>
>
>
>
>
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
>
> Of Jeremy Burns |
at is) if it validates.
Not being an ass but that sounds like saveSome() if your validating it
first.no?
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns | Class Outfit
Sent: Friday, April 01, 2011 12:53 AM
To: cake-
Couldn't you write a custom validation rule in the Post model that examines the
count of the Category key of the data array passed in?
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 1 Apr 2011, at 01:18, Krissy Masters wrote:
> How can you validate the numb
On Sun, Mar 27, 2011 at 5:26 PM, Ryan Schmidt
wrote:
> On Mar 27, 2011, at 10:22, euromark wrote:
>
>> and it assumes that you actually use "transactions" which which mysql
>> and isam i do not :)
>> mainly because some databases can't be switched that easily
>> so i prefer using a complete app-ba
On Mar 27, 2011, at 10:22, euromark wrote:
> and it assumes that you actually use "transactions" which which mysql
> and isam i do not :)
> mainly because some databases can't be switched that easily
> so i prefer using a complete app-based approach
Yeah, if you're still using MyISAM I can't help
and it assumes that you actually use "transactions" which which mysql
and isam i do not :)
mainly because some databases can't be switched that easily
so i prefer using a complete app-based approach
On 27 Mrz., 04:59, Ryan Schmidt wrote:
> On Mar 26, 2011, at 21:45, euromark wrote:
>
> > On 27 M
On Mar 26, 2011, at 21:45, euromark wrote:
> On 27 Mrz., 03:26, Ryan Schmidt wrote:
>> If the title is supposed to be unique, put a UNIQUE index on the title
>> column in the database. That will prevent duplicates from being inserted.
>> Though it won't necessarily help you get a user-friendly er
exactly, ryan
thats too late if you want to validate all of em first before starting
to insert them into the database
@cricket:
yeah, that was a relict from the old method of mine - from back in the
day when i didnt know about list()^^
On 27 Mrz., 03:26, Ryan Schmidt wrote:
> On Mar 26, 2011, a
On Mar 26, 2011, at 18:40, euromark wrote:
> I encountered this problem several times with some batch imports or
> multiple form boxes saved together.
>
> You have a validation rule "isUnique" for the title.
> If you validate all your - lets say 15 - records, they are OK, even if
> two of them h
On Sat, Mar 26, 2011 at 9:00 PM, euromark wrote:
> just wrote something myself - although its not tested yet, either:
>
> /**
> * @param array $data
> * @param array $options
> * - scope (array of other fields as scope - isUnique dependent on
> other fields of the ta
just wrote something myself - although its not tested yet, either:
/**
* @param array $data
* @param array $options
* - scope (array of other fields as scope - isUnique dependent on
other fields of the table)
* - batch (defaults to true, remembers previo
On Sat, Mar 26, 2011 at 7:40 PM, euromark wrote:
> I encountered this problem several times with some batch imports or
> multiple form boxes saved together.
>
> You have a validation rule "isUnique" for the title.
> If you validate all your - lets say 15 - records, they are OK, even if
> two of th
Try adding:
'required' => false,
'allowEmpty' => false,
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Roger Pitigliani
Sent: Saturday, February 19, 2011 1:11 PM
To: cake-php@googlegroups.com
Subject: Validate - Version 1.3.7
Hi.
My validator not workin
Miles J, it's all i want to know. If validates() supports only one
array dimension, i can't validate like i did. =/
Thank you folks.
On Feb 14, 4:19 pm, Miles J wrote:
> I believe you have to use saveAll() in this instance, validates() only
> supports 1 array dimension.
>
> On Feb 14, 9:23 am, D
I believe you have to use saveAll() in this instance, validates() only
supports 1 array dimension.
On Feb 14, 9:23 am, Dee Johnson wrote:
> I'm not 100% sure I understand what you are going for here, but if all you
> want to do is validate the input THEN save, which is what I gather from your
> q
I'm not 100% sure I understand what you are going for here, but if all you
want to do is validate the input THEN save, which is what I gather from your
question (please correct me if I'm wrong) then you need to move your
validation code to the model and anything else if you want to do before a
required=>true is never a solution
in my option :)
On 7 Okt., 19:57, and wrote:
> I would also suggest to put
>
> 'required' => true
>
> in your validation, just to be sure! :-)
>
> On 7 Okt., 09:16, xamako wrote:
>
>
>
> > Hi,
>
> > I'm trying to validate a select field.
>
> > 'poblacion_id'=>
I would also suggest to put
'required' => true
in your validation, just to be sure! :-)
On 7 Okt., 09:16, xamako wrote:
> Hi,
>
> I'm trying to validate a select field.
>
> 'poblacion_id'=>array(
> 'rule' => 'notEmpty',
> 'message'
You also may want to validate the actual values as a user an easily change
the values in the select and put any value they want.
-Original Message-
From: xamako [mailto:xam...@gmail.com]
Sent: October-07-10 5:36 AM
To: CakePHP
Subject: Re: Validate input select
Solved!
The error was
Solved!
The error was in the name of the field.
Thanks!
On 7 oct, 09:16, xamako wrote:
> Hi,
>
> I'm trying to validate a select field.
>
> 'poblacion_id'=>array(
> 'rule' => 'notEmpty',
> 'message'=>"Debe seleccionar un valor."),
many thanx Nabil
many thanx Dr.loboto
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googleg
You can setup normal validation for each of OR fields (with allowEmpty
= true) and check validation status for both in beforeSave. Return
false if both are invalid or empty and true in other case.
On Aug 3, 8:25 pm, "rez...@gmail.com" wrote:
> hi
> I have a form with three fields and I need to va
There is no OR operation when validating fields... I think your two
options are to either not require the filed, i.e 'required'=>false as
part of your rule or to write a custom validator function to do what
you want.
On Tue, Aug 3, 2010 at 8:25 AM, rez...@gmail.com wrote:
> hi
> I have a form wit
Further to my last post - please excuse my noob ignorance, I need to
call the validation
So I have added the following to my code:
$this->Formextra->validates($this->data)
and surprise, surprise the validation works.
P_G
Check out the new CakePHP Questions site http://cakeqs.org and help other
Hi Cricket,
Thanks for the response.
Yes, we will be upgrading the app but its not scheduled for this round
of work (I'm still learning my around cake).
WRT to my initial question - thanks again. The reason that I have
created a dummy model is to apply validation against those fields.
However,
The form does not contain any hidden fields for "mdate". I just want
the controller to be able to supply the model with the mdate value
instead of the user input. Hence the mdate value is already empty
because there is no any value for it in the form. I think that Cake
applying an automated data (d
On Fri, Jul 23, 2010 at 8:35 AM, Papa_Gateau wrote:
> Hi I'm using cake 1.1 and am fairly new to it - I've inherited a
> fairly complex application which I have been tasked with updating.
First thing: consider upgrading the app immediately, rather than
adding even more functionality. You'll have
You haven't shown us the structure of $this->data for all we know the
mdate field does exist and is an array of datetime format which means
its not empty even though the values of each name value pair in the
array maybe Empty.
Also what does your form create code look like. Do you have a hidden
in
I use 1.2. Already I changed the field name from mdate to created and
it works fine now. However, the question is remained and it need to be
answered. What could we do if we want more than one or two datetime
fields in the table or at least we want to give the datetime fields
other names. Is there
and if you use cake1.3
check out how the arrays are properly structured (yours are not)
On 22 Jul., 03:40, huoxito wrote:
> I guess you should use cake convention flelds for this which are
> 'created' and 'modified' instead of 'mdate' in your case.
>
> If you have those fields in your table you w
I guess you should use cake convention flelds for this which are
'created' and 'modified' instead of 'mdate' in your case.
If you have those fields in your table you won't have to bother about
validating or saving manually that datetime of your records.
On 21 jul, 17:37, saidbakr wrote:
> Hi,
>
Hi marco!
I use: $this->myModel->validate = Set::merge($this->myModel->validate,
$newValidation); where $newValidation has the new rules to the specific
case. for example:
$newValidation= array('name_of_the_field_in_the_model_validation' =>
array('name_of_validation' => array('rule' => VALID_
Thank you guys, this was really helpful
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googl
Right, but not everyone uses secure connection for user registration,
and honestly I can't
remember a single site which doesn't clear the password field on
registration error.
On Jun 5, 3:20 am, calvin wrote:
> I don't get that. I think that presents a false sense of security.
>
> It's best pract
I don't get that. I think that presents a false sense of security.
It's best practice to use a secure connection whenever you're
transmitting passwords. And if you're handling the request over secure
http, then it doesn't matter if you send the password back to the
user.
On Jun 4, 10:08 am, vekij
If you don't want to reenter the password, you can use a different
name for the password input.
For instance:
View:
$this->Form->input('new_password', array('type' => 'password'));
Controller:
if(!empty($this->data['User']['new_password']))
{
$this->data['User']['password'] = $this->Auth->
When you have an error on the registration form, it is a best practice
to clear the password value and force the user to renter that info.
So, in the controller...
if($this->User->save($this->data)) {
// ... whatever you do after user had registered successfully
} else {
// ... there was an e
On 05/21/10 18:51, Henrik Gemal wrote:
> I have a controller which is being called with different paramters
> like:
> /test/do?start=2010-01-01&end=2011-01-01&test=1&super=8
>
> Now I like to user cake to validate the input parameters. How do I do
> that?
>
> I like to specify that start and end ar
you can user cakephp validation here the example form cakephp validation.
in your model you can user this code.
var $validate = array(
'field_name' => array(
'rule' => array(
'minLength',
Use $this->validates()
But why not use Cake's named parameters? (e.g. /test/do/start:
2010-01-01/end:2010-01-01/test:1/super:8)
On May 21, 11:51 am, Henrik Gemal wrote:
> I have a controller which is being called with different paramters
> like:
> /test/do?start=2010-01-01&end=2011-01-01&test=1&
No, it is not a bug! It is clearly described in the CakePHP book.
'rule' => 'ruleName', // or: array('ruleName', 'param1', 'param2' ...)
Second format is the one you are concerned about I assume, but it is
documented.
Version 1.3: http://book.cakephp.org/view/1145/One-Rule-Per-Field
Version 1.2:
On Wed, Apr 28, 2010 at 3:15 AM, Jonas wrote:
> Hello,
>
> Can I validate an array that looks like this somehow with the standard
> validation rules?
>
> [Trip]
> [Passengers]
> [1] => Array
> (
> [passenger_firstname] =>
> [passenger_lastname] =>
> [pass
Check the Cookbook http://book.cakephp.org/view/127/One-Rule-Per-Field
On Apr 22, 10:10 am, Angelo wrote:
> Hello,
>
> I juste discover ina blog article that we can use a "on" value in
> $validate array.
>
> Is there somewehere documentation about all value we can put in
> $validate array?
>
> Th
Sorry, I thought you wanted to save the CC field :)
You can instantiate the Validation class yourself and use the email
validation method to validate each of your CC addresses.
See http://api12.cakephp.org/class/validation#method-Validationemail
for the Validation class source.
Should someone else
Is there a way to manually call the validation checks?
So psedo code like:
foreach ($ccs as $cc)
$validate->email($cc)
?
On Apr 15, 5:42 pm, John Andersen wrote:
> Yes, you can make your custom validation function for that field.
> See the CakePHP book
> at:http://book.cakephp.org/view/150
Yes, you can make your custom validation function for that field.
See the CakePHP book at:
http://book.cakephp.org/view/150/Custom-Validation-Rules
Enjoy,
John
On Apr 15, 6:10 pm, Henrik Gemal wrote:
> Is there a way to validate a form entry where people can enter one or
> more email addresse
Model may be tableless as well. Validation isn't connected with save
process or table fields.
http://book.cakephp.org/view/436/useTable
http://book.cakephp.org/view/410/Validating-Data-from-the-Controller
On Apr 15, 3:31 pm, Henrik Gemal wrote:
> In my CakePHP application I have an action that s
Behalf
Of Miles J
Sent: January-07-10 2:24 PM
To: CakePHP
Subject: Re: Validate Question
You will have to set the validation rule during runtime in your model/
controller, like so:
$this->Model->validate['field']['inList'] = array('rule' => array ('inList
You will have to set the validation rule during runtime in your model/
controller, like so:
$this->Model->validate['field']['inList'] = array('rule' => array
('inList', $myListVariable));
On Jan 7, 2:06 am, John Andersen wrote:
> Hi Dave,
>
> Is your rule made in accordance with CakePHP custom v
Hi Dave,
Is your rule made in accordance with CakePHP custom validation rules?
If yes, then I don't see a better solution.
See
http://book.cakephp.org/view/150/Custom-Validation-Rules#Adding-your-own-Validation-Methods-152
for the custom validation rules.
Enjoy,
John
On Jan 7, 7:48 am, "Dav
Alternatively, if this is an update form - if you don't want to update
the password for example, and therefore leave it blank, by simply not
validating you will update your password to a blank password. Not
what you're intending, I'd imagine.
If password is set to notEmpty or required, make sure
you set the validation rules in the Model of whatever your using (i'm
guessing users model) /app/models/user.php
search for cakephp validation in google and look in the cakephp
manual, it should be what you need.
On Jan 5, 6:53 pm, kicaj wrote:
> How validate field only we entered some value int
i'd say your validation array is incorrect
'website' => array(
'RULENAME' => array(
array(
'required' => false,
'allowEmpty' => false,
'rule' => array('url', true),
'message' => '* Please enter a valid URL.',
'last' => true),
), ...
whereas RULENAME wou
This regular Expression will force a number between 0-23
Raw Reg ex:
^1?[0-9]{1}$|^2[0-3]{1}$
I'm remembering for php some of these char in the regex provided need
to be escaped.
Formated for PHP:
/^1?[0-9]{1}$|^2[0-3]{1}$/
And here is a good on line real time tester for regular expressions:
htt
I would just create a custom validation function:
/**
* function intRange
*
* Checks if a value is an integer within the
* range given (inclusive)
*
* @param $value to be checked
* @param $start of range
* @param $end of range
* @return bool
*/
function intRange($value,$start,$end) {
err... never mind... doesn't help with decimals
On Sat, Nov 28, 2009 at 1:35 PM, Dave wrote:
> He can then add the "numeric" rule as well
>
>
> On Fri, Nov 27, 2009 at 9:30 AM, r4zv4n wrote:
>
>> 'range' still won't fit his purpose, as it will allow for non-integer
>> values ;)
>>
>> On Nov 27,
He can then add the "numeric" rule as well
On Fri, Nov 27, 2009 at 9:30 AM, r4zv4n wrote:
> 'range' still won't fit his purpose, as it will allow for non-integer
> values ;)
>
> On Nov 27, 8:54 am, jburns wrote:
> > Ah - yes - good call. It was late...!
> >
> > I should have said 'rule' => arra
'range' still won't fit his purpose, as it will allow for non-integer
values ;)
On Nov 27, 8:54 am, jburns wrote:
> Ah - yes - good call. It was late...!
>
> I should have said 'rule' => array('range', -1, 24).
>
> I agree with you that the best way is to present a drop down list as
> that precis
Ah - yes - good call. It was late...!
I should have said 'rule' => array('range', -1, 24).
I agree with you that the best way is to present a drop down list as
that precisely controls the available inputs.
On Nov 27, 6:39 am, r4zv4n wrote:
> 'between' actually means that the data's length shoul
'between' actually means that the data's length should be between
those numbers (i.e. between 0 and 23 characters), so that won't work.
One easy solution would be to use 'inList', like this: 'rule' => array
('inList', array(0,1,2,3,..,23))
I'm assuming that on the client side, you're actually
I think you'd have to add two rules which, when combined, only accepts
the data you want. A custom rule should do it too - I'll have a go
tomorrow if this is still open. In the meantime, try this:
http://book.cakephp.org/view/246/decimal
...but with a 0 for the number of decimal places. Don't kno
Kind of. But this also allows "0.01"
How would I allow only 0, 1 ...23 and NOT numbers like 0.01
On Nov 26, 7:48 pm, jburns wrote:
> array('rule' => array('between', 0, 23),
> 'message' => 'Please enter a number between 0 and 23.')
>
> On Nov 26, 6:41 pm, "ge...@dinnerbooking.com"
>
> w
array('rule' => array('between', 0, 23),
'message' => 'Please enter a number between 0 and 23.')
On Nov 26, 6:41 pm, "ge...@dinnerbooking.com"
wrote:
> I have an field which is an hour:
>
> "hour" => array(
> "required" => true,
> "allowEmpty" => false,
> "rule" =>
ering or why it error div appears
when valid?
Any help or suggestions would be great.
Thanks
Dave
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of euromark (munich)
Sent: November-07-09 1:56 PM
To: CakePHP
Subject: Re: Validate a single fi
just submit only that field
the model validation is only triggered for fields that are beeing
passed
so if there is only one passed form field, only this one will be
validated
PS: dont use "required''=>true" in your rules or you screw it up
On 7 Nov., 17:43, "Dave" wrote:
> How can I validate
actually I was using the default cakephp postal validation but your
post directed me towards the creation of a custom validation rule that
checked to see if the entry was alphanumeric or just numeric and ran
the proper validation rule from there.
Thanks for the lead!
Josey
On Oct 16, 4:48 pm, "
I'm assuming you have a postal($zipcode) function in your model to handle
the validation. You could use this to validate the Canadian postal code
part:
if(preg_match("/^([a-ceghj-npr-tv-z]){1}[0-9]{1}[a-ceghj-npr-tv-z]{1}[0-9]{1}[a-ceghj-npr-tv-z]{1}[0-9]{1}$/i",$zip_code))
return true;
Best
1 - 100 of 201 matches
Mail list logo