Hi,
Thanks for the excellent tutorial. There's one question I'd like to ask, as I haven't been able to find the answer in the forums or API documentation.
I have included a hidden field on my form (using InputfieldHidden). This works fine, but displays a label for the hidden field (which I don't want). It uses the name/id for the label. I have tried setting the label using $field->label = '';, but it still displays the label. Is there anyway to prevent this? (I could make it disappear using CSS, but would rather it wasn't there at all.)
Just by way of explanation. The form has three fields for providing a phone number, email address and street address. The person submitting the form has to supply at least one of these. I have a test to make sure that is the case in the field processing and set an error if this is not the case.
The three fields are in a fieldset, and I tried adding the error to the fieldset (for which I set an id and name), but that doesn't display the error message on screen when the form is submitted. It also doesn't make sense to add the error to one of the three existing fields. So that is why I'm adding a hidden field. If there is an error I attach the error to the hidden field, and on submission the error is displayed in the location of the hidden field - which is great. It's just that the hidden field label is displayed too, which I don't want. (The label displays when the form first displays too - not just when there is an error.)
Any suggestions appreciated - including any better way to achieve this outcome.
Thanks!