I tested with HTML5 number field, but do not work...
(sry i little speak english :( )
my entity:
.....
/*
* @var integer
* @Assert\NotBlank()
* @Assert\Type(type="integer")
* @Assert\Range(min="1",max="10")
/
private $columns;
....
function SymfonyComponentValidatorConstraintsType() {
....
case 'int':
case 'integer':
case 'long':
// egg bugfix mert number tipusu adat nincs jsben! ezert a === nem mukodik
isValid = (value == parseInt(value));
break;
and
fp_js_validator.js
function SymfonyComponentValidatorConstraintsType() {
....
case 'int':
case 'integer':
case 'long':
// egg bugfix mert number tipusu adat nincs jsben! ezert a === nem mukodik
isValid = (value == parseInt(value));
break;
why
=== check is type, but html5 number input value is string!!!
I do not think this Bundle works with HTML5 validation now, it reimplement it mostly.
Integration with HTML5 validation it would be another bit task #75
Hello!
I tested with HTML5 number field, but do not work... (sry i little speak english :( ) my entity: ..... /* * @var integer * @Assert\NotBlank() * @Assert\Type(type="integer") * @Assert\Range(min="1",max="10") / private $columns; ....
form:
->add( "columns", "integer", array( 'data' => 1 ) )
I will never be the valid forms...
my bugfix: Type.js
function SymfonyComponentValidatorConstraintsType() { .... case 'int': case 'integer': case 'long': // egg bugfix mert number tipusu adat nincs jsben! ezert a === nem mukodik isValid = (value == parseInt(value)); break;
and
fp_js_validator.js function SymfonyComponentValidatorConstraintsType() { ....
why === check is type, but html5 number input value is string!!!
i found intrested post: http://stackoverflow.com/questions/18852244/how-to-get-the-raw-value-an-input-type-number-field
thanks eggp