Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MoneyField not validated #37

Open
brasileric opened this issue Nov 20, 2015 · 1 comment
Open

MoneyField not validated #37

brasileric opened this issue Nov 20, 2015 · 1 comment

Comments

@brasileric
Copy link

Hi,

I have a MoneyField in my form, but if I add the name of this field to addRequiredFields it's not validated.

MoneyField::create('Price', 'Price);

$validator->addRequiredFields(array(
        'ProductPropertyID',
        'Quantity',
        'UnitWeight',
        'Price'
    ));

Other fields work well with validation.

@lekoala
Copy link
Collaborator

lekoala commented Oct 10, 2016

Well, this is due to the fact that MoneyField actually holds two inputs and use a custom rendering system. It's probably best to create your own subclass of MoneyField and injecting in the fields the data-parsley attributes...

Otherwise, maybe we could create some kind of validation wrapper that could be used also for the CheckboxSetField or any kind of custom field that may cause problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants