I've been wondering where the nested div structure surrounding form fields came from since I could find no template anywhere that specified this.
I finally found it within the FormField.php file (sapphire/forms/FormField.php), which seems a little odd... The functions 'Field', 'FieldHolder' and 'SmallFieldHolder' are all culprits in actually generating html, instead of passing data to a template.
Is there any particular reason for doing it this way? It makes customising form structure more complicated than just having a suitable template local to the site folder.
So, to get around this and regain control, what is the best route. Do I create a local copy of FormField.php as mysite/code/CustomFormField.php?
That being the case, should it extend FormField or RequestHandler, or would either one do?
Also, how and where do I control the insertion of javascript related to form fields that don't exist? For example, my search form consists of an input and an action, yet there is javascript being auto inserted that relates to select lists and textareas that aren't there... Why? Can they be safely removed and if so, how/where?
Thanks in advance.
Rob