How to validate field with brackets in name |
Hi,
i have 3 radio buttons with the following name: radio name="button[10]" value="15" radio name="button[10]" value="16" radio name="button[10]" value="17" This is the rule: PHP Code: $rules = [ If i check one radiobutton the error message is still displayed. what i am doing wrong?
(09-07-2022, 03:33 AM)JustJohnQ Wrote: Try changing button[10] in rules to button.* Thank you :-), this seems to work, but i have groups of buttons with the name name="button[20]" and name="button[30]" How can i validate this different fields individually? Every radio button group should have it's own error message. With button.* all fields will be affected.
09-07-2022, 03:55 AM
(This post was last modified: 09-07-2022, 03:59 AM by JustJohnQ. Edit Reason: added link to documentation )
(09-07-2022, 03:55 AM)JustJohnQ Wrote: button.10 etc.... I tried this but it was not working because of a typo Found the dot notation in the documentation. Now it is working. Thank you very much for your help
@groovebird
will you please help us ' what was and where was ' that " typo " (the dot notation) and how you resolve this problem? so, the juniors should be aware of it. thanks in advance. Newbie here in CodeIgniter World !! Please appologize if any nonsense from me.
environment: Windows 10, XAMPP 3.3.0, VS Code, SQLyog Community Ed.
@Ahmed Haroon i used the dot notation but misspelled the name of the input field in the showError() function. This was the reason why no error message was displayed
$validation->showError('button.10') shows me the correct error message
(09-08-2022, 01:22 AM)groovebird Wrote: @Ahmed Haroon i used the dot notation but misspelled the name of the input field in the showError() function. This was the reason why no error message was displayed thanks for your feedback, this will help us for sure. Newbie here in CodeIgniter World !! Please appologize if any nonsense from me.
environment: Windows 10, XAMPP 3.3.0, VS Code, SQLyog Community Ed.
|
Welcome Guest, Not a member yet? Register Sign In |