The PHP script doesn't know about any that were left unchecked.(Java Script can determine whether or not certain ones are checked.that validates whether the city and zip code match.Unfortunately, there is no "matching City And Zip Code" field in your form, so all that Symfony can do is display the error on top of the form.Form names and values other than checkboxes and radio buttons are always sent to the PHP script the form is submitted to.For checkboxes and radio buttons, the names and values are sent only if the checkbox or radio button is checked.That's because Java Script is running on the same page as the form.However, some browsers don't run Java Script, and neither do robots.) With PHP, after the form is submitted, the page and the form are unavailable to the PHP script.
This is also the name of the variable to be used in custom template files, in order to display the control.Only the submitted form field names and values exist for the script.I was setting up an HTML form today and I wanted to group some options together in a multi checkbox set, allowing a user to select multiple options in a category.With customized error mapping, you can do better: map the error to the city field so that it displays above it: default: The label is "guessed" from the field name Sets the label that will be used when rendering the field. and also capture loop through each array data and display them. We will be using PHP’s array_map() to return the data array after applying our custom validation function to each array element.