Linux is case sensitive, windows isn't
At Linux, You can have at the same directory the files: inventory.php and
Inventory.php
Henrique Machado
TI Expert
2010/3/19 SeeVik
> Hello all
>
> Thanks for guiding me out of this problem.
>
> @ Dr. Loboto - Yes that was the problem. The model filename
Hello all
Thanks for guiding me out of this problem.
@ Dr. Loboto - Yes that was the problem. The model filename was
Inventory.php. As soon as I changed it to inventory.php, it worked
like a charm. Although why it worked on Windows local server and not
on Linux web server is what I don't get. Any
I also vote for problems in the path/filename.
Be sure exactly what file you edit (the model) - I had exactly the
same problem - it turned out that i was editing a wrong file.
When I opened the correct one, all worked fine.
Your file for the model is inventory.php in the app/models, right?
Check
@sooraj: If using the form helper it automatically includes validation
errors unless your suppress it by setting error=>false
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
Haven't read the post in full but think I have something that will
help. I have a recurring comments form at the bottom of various
modules across my portal site and I created it with the following:
$form->create(null, array('url'=>array('action'=>'comment',
'#commentForm'), 'id'=>'commentForm'));
Now here's a tricky extension (still determined to avoid AJAX). When
my form fails, and validation errors pop up, how could I have the page
jump to an anchor link connected to the form? The top section of my
page is somewhat large, so I'd like to avoid excessive scrolling with
an a
Having the form submit to the index() function worked brilliantly. To
my surprise, this enabled the automagic validation messages!
All I have to do now is style the messages with CSS, and I have the
trickiest part of my project done. I'll be sure to post a link to the
blog post I plan to wri
guson wrote:
>
>
>
> > Hi,
>
> > I've poured over all the documentation I possibly can, and searched
> > the newsgroups, and haven't yet found a solution to my problem.
>
> > I'm creating a contact form which doesn't use any databases. As t
uson wrote:
>
> > > Hi,
>
> > > I've poured over all the documentation I possibly can, and searched
> > > the newsgroups, and haven't yet found a solution to my problem.
>
> > > I'm creating a contact form which doesn't use any dat
, I don't get any of the nice
> automatic validation.
>
> Here are my files:
>
> Contact Model:http://bin.cakephp.org/view/568757600
> Contacts Controller:http://bin.cakephp.org/view/1939947381
> /views/contact/index.ctp (main form):http://bin.cakephp.org/view/
> 526960429
Hi,
I've poured over all the documentation I possibly can, and searched
the newsgroups, and haven't yet found a solution to my problem.
I'm creating a contact form which doesn't use any databases. As the
controller action never calls save(), I don't get any of the
actually you havent set the display option to show error in your view file
isFieldError('Inventory.make'))
e($form->error('Inventory.make', null, array('class' => 'message')));
hope this solves your problem
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their C
Check model filename - it should be lowercased. If your model is not
loaded you'll note absence of validation rules.
On Mar 16, 7:57 am, SeeVik wrote:
> Hello there Lucca
>
> I double checked the server database. Its the same as local database.
> Since I am doing this applicatio
Mordente wrote:
> Probably there is an error at database level. Make sure your server
> table structure and constraints are the same of your local machine.
>
> On 15 mar, 01:20, SeeVik wrote:
>
>
>
> > Hello all
>
> > I am using CakePHP 1.2 and I am trying to impleme
Probably there is an error at database level. Make sure your server
table structure and constraints are the same of your local machine.
On 15 mar, 01:20, SeeVik wrote:
> Hello all
>
> I am using CakePHP 1.2 and I am trying to implement a simple form data
> validation. The thing is t
Hello all
I am using CakePHP 1.2 and I am trying to implement a simple form data
validation. The thing is that the data validation works on my local
machine but it doesn't work on my rental server (Linux FreeBSD
server).
Here's my model
array(
'rule
ed. So what's the new way of doing
> > > it?
>
> > > Thanks and Regards
> > > ShiVik
>
> > > On Mar 11, 8:32 pm, euromark wrote:
>
> > > > always use $form->input()
> > > > this will make a lot for u automatically
>
at
> > in cakephp 1.2 it has been deprecated. So what's the new way of doing
> > it?
>
> > Thanks and Regards
> > ShiVik
>
> > On Mar 11, 8:32 pm, euromark wrote:
>
> > > always use $form->input()
> > > this will make a lot for u autom
lly
>
> > On 11 Mrz., 11:19, SeeVik wrote:
>
> > > Hello all
>
> > > I am using cakephp 1.2 and I am having problem in displaying the error
> > > messages for the data validation of a form. I created the form like
> > > this
>
> > &g
e:
>
>
>
> > Hello all
>
> > I am using cakephp 1.2 and I am having problem in displaying the error
> > messages for the data validation of a form. I created the form like
> > this
>
> > create( 'Posts', array( 'action' => '
always use $form->input()
this will make a lot for u automatically
On 11 Mrz., 11:19, SeeVik wrote:
> Hello all
>
> I am using cakephp 1.2 and I am having problem in displaying the error
> messages for the data validation of a form. I created the form like
> this
>
>
Hello all
I am using cakephp 1.2 and I am having problem in displaying the error
messages for the data validation of a form. I created the form like
this
create( 'Posts', array( 'action' => 'index' ) ); ?>
text( 'text' ); ?>
text( 'val
This regexp should do it: '/^[0-9]+(\.?[0-9]+)?$/'
But you should probably just use is_numeric()
On Mar 10, 5:19 am, Eleazar wrote:
> Hi, sorry to ask, still struggling with this...
> is it possible to allow integer numbers and decimals on the decimal
> validation rule?
>
Hi, sorry to ask, still struggling with this...
is it possible to allow integer numbers and decimals on the decimal
validation rule?
thanks
On Mar 8, 7:19 pm, Eleazar wrote:
> Hi all,
> I'm not sure if it's possible or if I have to write my own regex, but
> my input data f
Hi all,
I'm not sure if it's possible or if I have to write my own regex, but
my input data fails on the decimal validation when I enter a whole
value such as 100. I would like to accept integer values but also
floats eg. 100, 100.0, 100.1, 100.2 etc. I couldn't see any way to do
You could also take a look at this example which shows how to have
different validation based on which action was called for the
controller. So you can have a validation based on the 'add' action
which is completely different from the validation you might use on
'edit' or
According to the CakePHP book, your validation code looks correct!
But I am not familiar with version 1.3, so I hope that someone else
can assist you :)
Until then, good luck with finding the right solution,
John
On Feb 28, 6:56 pm, mivogt-LU wrote:
> hmmm I created the view using
hmmm I created the view using the bake shell ; cake 1.3ß used to
be most up-to-date ... so it is some 'original' code
and as I wrote, if I use a built in validation the error message is
shown
On 28 Feb., 17:48, John Andersen wrote:
> Hmm I don't actually see anythi
Hmm I don't actually see anything wrong with your validation
definition and function. But I wonder about your view!! As far as the
CakePHP book states, you should use the FormHelper using the $form
object in the view! I have no idea whether that could be the reason,
but have you tried to co
;input('AnzahlKinder');
?>
Form->end(__('Submit', true));?>
so I have no idea why my message is not shown, but if i use a built in
one like requiered/notempty the message is shown.
Any hint so far?
TIA
Michael
On 28 Feb., 09:20, John Andersen
wrote:
> [cake 1.3ß | XAMPP 1.7.3|PHP 5.3.1|MySQL 5.1.41 | Win XP SP3]
>
> Hi everybody,
>
> I just has a little problem with my error-message in a custom
> validation function.
> If I use the built in functions like required the message is shown so
> css and div seem to
[cake 1.3ß | XAMPP 1.7.3|PHP 5.3.1|MySQL 5.1.41 | Win XP SP3]
Hi everybody,
I just has a little problem with my error-message in a custom
validation function.
If I use the built in functions like required the message is shown so
css and div seem to be ok
If I use my own function there is a red
You could also setup up the framework of your validation rule in the
model itself. Then you can update the details in the controller as
Alan suggested. This could help in making sure the rule will fail by
default just in case your api doesn't actually change the rule
accordingly. Also, tha
#x27;message'=>"Allowed range for bid is {$this->MyModel->minimum_bid} - {$this->MyModel->maximum_bid}");if ($this->MyModel->save($this->data)) {...}so the save function still runs the validate and I set the minimum and maximum bid during the beforeFilterHope thi
I am creating an API for my website and I want to create validation
rules for my various methods based on some rows in my api_arguments
table. How should I go about doing this? Thanks for any help.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP
All too often guilty of the same myself :o)
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@g
You can add validation rules to your models for fields which do not
exist in the table, think of the common password confirm field when
registering a user.
Validation requires those fields to pass whatever rules you set, but
save ignores them. Much cleaner to process your validation with one
e.preventDefault();
myAjaxSettings.url = $("#MyForm").attr('action');
myAjaxSettings.data = $("#MyForm").serialize();
$.ajax(myAjaxSettings);
});
});
Then in the controller do your validation as such:
Configure::write('debug','0');
$this->autoRende
please don't!! don't check that within the controller and don't even think
about check it with javascript!! :'( use Model's custom validation, these
don't need fields to be a field of your database, within a custom validation
function you can just check if you have
Check for their presence/value in the controller, and then unset them from the
array before saving.
Jeremy Burns
jeremybu...@me.com
On 23 Feb 2010, at 12:16, Zac Tolley wrote:
> Ah but, the thing is I'm verifying fields that are not part of the
> model, I'm simply verifying that they agree to
Though that said, thats what you are saying :) and but the terms
thing..? I might just cheat and put in some JS to check that they
agree to the terms
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because
Ah but, the thing is I'm verifying fields that are not part of the
model, I'm simply verifying that they agree to some terms and that the
2 passwords they entered match
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received t
7; => true,
'message' => 'Musisz zaakceptować regulamin',
'on' => 'create',
),
),
);
ps.: (there is no accept_terms in my database table of course.
and add to it custom validation rules (links in WebbedIT post)
You may want to have a good read of the existing core rules to make
sure they can't do what you're after:
http://book.cakephp.org/view/134/Core-Validation-Rules
And then read the page about custom rules:
http://book.cakephp.org/view/150/Custom-Validation-Rules
HTH
Paul
Check o
of course you can!...and you should! ;) CakePHP Models let you spice them
with custom validations, when in a validation array you say 'rule' =>
array()
the first parameter of the array can be the name of a custom validation
function in your model, then, when validation is fired up
I have created a form with the html and form helpers and setup
validation rules in my model and this seems to work pretty well
(anyone got this integrated with jquery?)
I have a question though, in my form I have a couple of extra fields,
one is a checkbox to accept terms and conditions, and
Good spot Paul - I replied too quickly!
Jeremy Burns
jeremybu...@me.com
On 23 Feb 2010, at 09:21, WebbedIT wrote:
> Your data should have been available at:
>
> $this->data['BookingPosition']['amountofadult']
>
> not
>
> $this->data['booking_positions']['amountofadult']
>
> Just clarifying th
Your data should have been available at:
$this->data['BookingPosition']['amountofadult']
not
$this->data['booking_positions']['amountofadult']
Just clarifying this in case other newbies read this post and get
confused.
Paul.
Check out the new CakePHP Questions site http://cakeqs.org and help
itions']['amountofadult'] ?
>
> > TNX
>
> > Michael
>
> > On 23 Feb., 09:35, Jeremy Burns wrote:
> >> The data is accessible via $this->data. If you debug it you'll see the
> >> shape of the array so you check values within it (someth
> TNX
>
> Michael
>
>
> On 23 Feb., 09:35, Jeremy Burns wrote:
>> The data is accessible via $this->data. If you debug it you'll see the shape
>> of the array so you check values within it (something like
>> $this->data['Model']['
7;]['amountofadult'] ?
TNX
Michael
On 23 Feb., 09:35, Jeremy Burns wrote:
> The data is accessible via $this->data. If you debug it you'll see the shape
> of the array so you check values within it (something like
> $this->data['Model']['field']
The data is accessible via $this->data. If you debug it you'll see the shape of
the array so you check values within it (something like
$this->data['Model']['field']. Your custom validation function should return
either true or false. If it returns false, your
hi there, I have some problems doing my first cake and adding some
validation methods on my own.
It would be great if someone in here might give me a good start and
help me to do my first steps ...
I am using 2 models linked with each other
lodgings : id, roomnumber, amountofbeds
I am not sure if it's the same problem i've got, but my issue was due
to not respecting naming convention. I missed model naming at plural.
Once I got everything to the single, it worked.
Hope it helped!
On Feb 4, 1:19 am, cricket wrote:
> cake_1.2.6
>
> I'm thoroughly confused by what's happeni
gt;error('credits')
to
$form->error('Credit.credits');
[/change]
Haven't tried it, so no idea if it will work!
Enjoy,
John
On Feb 19, 1:17 am, Cedric wrote:
> Hi I am developing an application for my uni project but I am having
> trouble with validation error mess
Hi I am developing an application for my uni project but I am having
trouble with validation error message doesn't show if the validation
error is in a different model
So where my validation is in the Credit Model but in an Administration
view/controller I save to the Credit Model
so my c
Hi I am developing an application for my uni project but I am having
trouble with validation error message doesn't show if the validation
error is in a different model
So where my validation is in the Credit Model but in an Administration
view/controller I save to the Credit Model
so my c
I have instructed my host to upgrade the software on the server as I
dont have control over it.
On Feb 18, 10:36 am, jperras wrote:
> 1) You're probably running CentOS on your production server.
> 2) CentOS ships with broken PCRE UTF-8 libraries.
> 3) A few of the validation rules
$saved
= false;
$message = "There was a problem when saving your details
to the database, Please try again";
}
1) You're probably running CentOS on your production server.
2) CentOS ships with broken PCRE UTF-8 libraries.
3) A few of the validation rules in CakePHP use multibyte flags (e.g.
for alphanumeric validation)
Combine the above, and you get the problem you've described.
Solutions:
Can you post your model and your controller action?
On Feb 18, 3:43 am, Atti wrote:
> Hi all,
> Just a quick question, I managed to get my data validation working
> perfectly on my local apache (XAMPP) web server, but as soon as I
> uploaded the site to the internet the validation f
Hi all,
Just a quick question, I managed to get my data validation working
perfectly on my local apache (XAMPP) web server, but as soon as I
uploaded the site to the internet the validation flag seems to be
always true, ie, there is not validation going on, so it seems. What
settings on my live
I would do something like this:
items_controller.php
function foo(){
if (!empty($this->data)) { //check if there is data sent
if($this->User->field('email', array('conditions' =>
array('email' => $this->data['User']['email']{ //find the emai in the
database
I have a form with an 'Item' and 'email' field. It submits to an
Items Controller.
I want to validate both fields, however, the 'email' is technically
part of a User model.
So what happens is, when the form is submitted, it's supposed to
search for the Item in the form. it also check if the emai
;
>> Next, how does one validate the data and properly save and find the
>> data. Here is what I am thinking (not tested).
>>
>> Validate the Model using a custom validation function:
>>
>> var $validate = array(
>>
a good
> usage?
>
> Next, how does one validate the data and properly save and find the
> data. Here is what I am thinking (not tested).
>
> Validate the Model using a custom validation function:
>
> var $validate = array(
> 'emails'
sage?
>
> Next, how does one validate the data and properly save and find the
> data. Here is what I am thinking (not tested).
>
> Validate the Model using a custom validation function:
>
> var $validate = array(
> 'emails' => array(
>
data. Here is what I am thinking (not tested).
Validate the Model using a custom validation function:
var $validate = array(
'emails'=> array(
'is_email' => array(
'rule' => array('g_
nd that the shape of the array is not what is expected.
>
> Jeremy Burns
>
> On 4 Feb 2010, at 04:25, cricket wrote:
>
> > Oops. I messed up the call to validate(). But, when I do ...
>
> > if ($this->User->create($this->data) && $this->User->v
create($this->data) && $this->User->validates())
> {
> if ($this->User->save($this->data, true))
> {
>
> ... validation passes! It should fail. WTF?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with the
Oops. I messed up the call to validate(). But, when I do ...
if ($this->User->create($this->data) && $this->User->validates())
{
if ($this->User->save($this->data, true))
{
... validation passes! It should fail. WTF?
Check out the new CakePHP Ques
cake_1.2.6
I'm thoroughly confused by what's happening (or not happening) with my
validation. For one thing, save() does not appear to be calling
validate(). Even when I pass true as the 2nd param, validation does
not occur.
Secondly, the validation, when called explicitly, seems t
the save() method.
whitelist as $cField) {
if (!isset($this->validate[$cField])) {
//--
d = 1234 before $this->Category->save
() because I presumed that find('first') would have the same effect
with the ActiveRecord approach. But I could be totally wrong on this.
And because, before adding the isUnique validation rule, my "save"
function did work.
Anyway, I just
_id is not empty myfield_id must be blank (children)
>
> So I wrote a isUnique validation rule for myfield_id. And it seems to
> works if I use the baked add and edit pages.
>
> Then I created another page that uses a javascript widget (tafelTree)
> to show the tree and to drag
I wrote a simple model that acts as a tree behaviour.
The model has a myfield_id field that must follow these rules:
- if parent_id is empty (root) myfield_id can't be blank
- if parent_id is not empty myfield_id must be blank (children)
So I wrote a isUnique validation rule for myfield_id
Thanks John,
It does strike me as a little odd that "'required' => true" is at the
individual rule(s) specific level, and not the field specific level...
as in:
var $validate = array(
'username' => array(
'required' => true, <-- SHOULD BE HE
rd']);
rest of code, where you do your update.
[/code]
The above turns off the two validation rules for username and password
so that you can save/update the other fields.
Enjoy,
John
On Jan 29, 7:27 pm, Craig Francis wrote:
> (Note: This is my first time using CakePHP).
>
(Note: This is my first time using CakePHP).
I have a fairly simple user model, with validation along the lines of:
var $validate = array(
'username' => array(
'notEmpty' => array(
I wrote a model that act as a tree (mymodel).
In mymodel.php file I coded some custom validation rule.
One of the rules is like the following:
function testmyfield($check) {
$grandfather = $this->getparentnode($this->data['Category']
['parent_id']);
if ($grandfat
I noticed a strange behaviour today.
I tried to enter some manual validation into a form.
This worked fine, except that the error message was printed out before
the input element:
Please select or
enter a Journal [...]
When I use the Model Validation, the Error Message is appended after
the
ixes this particular problem, consider applying it.
>
> --
> Veres-Szentkirályi András
>
> 0001-Fixing-the-e-mail-validation-regexp-foo.-bar.com.patch
> < 1KViewDownload
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP relate
om/group/cake-php?hl=en
From 52c9e17a1ef837b6c850c7f61edc7ed37604692c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?=
Date: Wed, 27 Jan 2010 05:02:27 +0100
Subject: [PATCH] Fixing the e-mail validation regexp (f...@bar.com)
---
cake/libs/validation.php |2 +-
1 files changed,
Hi Akeda,
Thanks! It worked!!!
On Jan 20, 10:46 am, Akeda Bagus wrote:
> On Thu, Jan 21, 2010 at 1:05 AM, leafchild wrote:
> > In my model,
> >
> > var $validate = array(
> > 'name'=>array(
> > 'no_empty'=>arr
On Thu, Jan 21, 2010 at 1:05 AM, leafchild wrote:
> In my model,
>
> var $validate = array(
> 'name'=>array(
> 'no_empty'=>array(
> 'rule'=>VALID_NOT_EMPTY,
>
In my model,
var $validate = array(
'name'=>array(
'no_empty'=>array(
'rule'=>VALID_NOT_EMPTY,
'message'=>'Please enter your name'
I've been meaning to add an enhancement request to this property, but
as it stands right now, you must use the appropriate value for the
'on' property. According to the Cookbook, you MUST use 'create' or
'update' as the values passed to the 'on'
'rule' => array('checkUnique',
'original_domain'),
'on'=>'create',
'message' => 'The original domain field already
exists.'
)
I am currently, using jquery validation plugin and I need it to check
the email fieled if is it unique or not... using AJAX check
that's all
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because yo
Hi
I'd like that validation to be made "on-the-fly", after a field is left,
and before submitting the form, i.e., using ajax.
I found this article
http://bakery.cakephp.org/articles/view/ajax-validation-component but it
looks pretty old, does it still work?
Any other sug
e:
>
> > > I can't agree, as I prefer to have the model be concerned with model
> > > things (data, retrieval, saving, validation, etc.), and the view
> > > concerned with presenting the data and the related error messages,
> > > including the localization!
t agree, as I prefer to have the model be concerned with model
> > things (data, retrieval, saving, validation, etc.), and the view
> > concerned with presenting the data and the related error messages,
> > including the localization!
>
> > Usually I only have one form in whic
Thanks John. Thanks Euromark. Really helpful...
On Dec 25, 9:55 pm, John Andersen wrote:
> I can't agree, as I prefer to have the model be concerned with model
> things (data, retrieval, saving, validation, etc.), and the view
> concerned with presenting the data and the related
I'm trying to put conditional validation in my form that validates a
correct CC is used depending on what CC was selected. Using the code
found at http://bakery.cakephp.org/articles/view/conditinalvalidation-behavior.
Seems to work for MC and Discover but not when I select VISA. If I
select
I can't agree, as I prefer to have the model be concerned with model
things (data, retrieval, saving, validation, etc.), and the view
concerned with presenting the data and the related error messages,
including the localization!
Usually I only have one form in which data for a specific mod
x27;error' => array('users_email_rule' => __
> ('users_email_rule',true) )
> )
> ) ;
>
> Observe the 'error' option! Here I use it to convert the validation
> message into the language that the user is viewing the form.
>
> Enjoy,
> John
>
'error' => array('users_email_rule' => __
('users_email_rule',true) )
)
) ;
Observe the 'error' option! Here I use it to convert the validation
message into the language that the user is viewing the form.
Enjoy,
John
On Dec 24, 7:39 pm, si-mon wrote:
> Hi All,
&g
$this->validationErrors[$field] = __($value, true);
}
}
i even added an array functionality to use
message = array('at least % chars', 255)
etc
On 24 Dez., 18:39, si-mon wrote:
> Hi All,
>
> Is there a way to use localization for validation messages in t
Hi All,
Is there a way to use localization for validation messages in the
Model $validate array?
eg: $validate = array ( 'name' => array('rule'=>'notEmpty',
'message'=>'Name is mandatory' ));
I need the message 'Name is mandato
When cake validates fields it first checks for field existence in data
array. If there is no such key, with required=true cake invalidate it,
with required=false cake skip it. So this flag behave exactly as it is
named. If field is required it must be present in data array.
On Dec 24, 1:21 am, Phi
901 - 1000 of 2727 matches
Mail list logo