since hours i am trying to find out what the problem could be here:
--> I have a Yii Form looks like this:
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'withdrawal-request-form',
'enableAjaxValidation'=>true,
)); ?>
...
...
...
$form->textField($model,'amount', array(
'class' => 'form-control name-field',
'placeholder' => $model->getAttributeLabel('Amount'),
'type' => 'number',
'min' => 10));
then i have my controller rules defined like this:
public function rules()
{
return array(
// username and password are required
array('IBAN, BIC, amount, payment_id, email', 'required'),
array('payment_id', 'numerical', 'integerOnly'=>true),
array('email', 'email'),
array('amount', 'numerical', 'min'=>10)
);
}
My goal to disallow values less then '10'
** what i have tried already**
The really strange thing is all other rules, like 'required', and wrong email field without @ letter etc. works really really great, so the connection between the form and the rules are working great. This test was successfull
When i try to enter a letter e.g. an "A" into my amount field, i am gettin imediatley an red HTML5 error back (perfect, works also fine)
but when i try to enter a number less then 10 for examnple 1 --> then i am getting no error back (first strange thing) and the next big problem is, after submit, i am getting only a blank white page back :(
i have also added this here "enableClientValidation'=>true" to my Form Code (also no success)
and then I have also tried to implement some validation rules directly into the yii form element like this here:
$form->textField($model,'amount', array( 'class' => 'form-control name-field', 'placeholder' => $model->getAttributeLabel('Amount'), 'type' => 'number', 'min' => '10'
--> also no success!
the crazy thing is when i remove my
array('amount', 'numerical', 'min'=>10)
rule out of my rules block, the submit an redirect process works great! but then i have numbers less then 10 in there becasue the "min=10 rule" was removed. BUT
when i add this line here again in to my rules
array('amount', 'numerical', 'min'=>10)
and then i am entering "1" into the amount field and then submit the form, yii is only displaying a white page!
so yii is recognizing, that i have entered a wrong value, but is only showing a white page
- YES, I have already tried to check the log file. no new entry!!
- YES, I have also reading the manual, but i followed exactly the steps and the way to set some new rules...
I really have no idea what the problem could be :(
Could you maybe give me any hint?!?
Thank you so much for any help!
Edit: ok I have found out, that the problem is that in my controller my $model->validate() is not true, and thats why the whole script will be skipped... i will check everything again and give a feedback here soon.