By jeebsuk on
Hi All,
I have a webform with a file_upload field on it. I need to reduce the size of the field (the appearance of it) to fit in a fairly small block (at the moment it just breaks out of the end of the block - and It's not appropriate for me to use overflow:hidden in the CSS). I have tried to do a form_alter hook with:
if ($form_id == 'name-of-web-form') {
//Do stuff to edit form
}
But it never bites, I have been debugging it with Eclipse and it just skips right over the breakpoint even though I have the correct form_id. Does anyone know if it is possible to alter webforms in this fashion?
Cheers
Comments
I have accessed the form in
I have accessed the form in the form_alter, but I do not know how to shrink the size of the file_upload field. Please help lol
FiveRDesign - UK Drupal Consulting, Development, Custom Modules & Support
MySweetShadow - Heavy Metal Blog, Drupal & SEO
theme_file()
You have to create a modified version of
theme_file()in your theme. You can then either control the length via thehook_form_alter
With hook_form_alter You could do it also in Your template.php.
Probably best to use isset()
Probably best to use isset() with the check for $form['#node'] in case the index doesn't exist (e.g. the search block form doesn't include this index).
the best mode to alter webform
Here is the solution
https://www.drupal.org/node/1462436#comment-8974109