jeudi 3 septembre 2020

Cannot validate dynamic radio button in Laravel

I have dynamic fields which i want to validate, validation is also dynamic from database,

foreach(...){    .. }

Now validation is working for textfields and dropdown but it is not working for checkboxes and radiobutton because when i have not checked the checkboxes or radio button it is not available in request and is not available in controller for validation.

Controller:

foreach($request->input('input_checkbox') as $key => $data) {
$ValidationString=$validationData['validations'];
$rules['input_checkbox'.$key] = $ValidationString;

In controller, i'm not getting the value if checkbox is not checked.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire