By hinchcliffe on
Hi there, I'm new to hook_form_alter. I was wondering if anyone could walk me through this.
I have a page set up here, it's an exposed views with a select menu. I'm trying to edit the #size attribute of the select menu. (Make it something like 8.)
So far I have created my module & enabled it. (My module name is dojo.)
The dojo.info file looks like this:
; $Id: dojo.info,v 1.9 2008/04/28 17:54:57 jsudesign Exp $
name = Dojo
description = Places a size option for select form.
dependencies = hierarchical_select
package = Form Elements
My dojo.module file looks like this.
<?php
// $Id$
/**
* @file
* Module to give #size attribute to hierarchical_select module dropdown.
*/
/**
* Implementation of hook_form_alter()
*/
?>
and know I need help, I'm not to sure where to start...
Can someone Please walk me through this?
Thanks, - Justin
Comments
Your link does not work but
Your link does not work but my guess is you can use css to limit the width of the select box.
(And please do not double post, duplicate removed)
Sorry for the double
Sorry for the double post,
Here's link
I'm not looking to edit the width. I'm looking to edit the size attribute in the select form with hook_form_alter.
If you need more info you can find it here: http://drupal.org/node/288833
I think you will find if you
I think you will find if you add the following to your themes style.css it will do what you want.
Just make sure you add it after the rule for
#views-filters select(around linf 1423 in style.css ) Size just determines the width in characters. The css while it does it any just about any unit but characters is far easier to implement (no code). Adjust the 100px as needed.nevets,
nevets,
I thought that Size would allow my select dropdown to show a limited number of options then create an auto scroll for the rest that are not visible.
I've tried to do this with css, nothing as worked so far.
Example.
This would only make two options visible in the dropdown, the rest would be scrollable to find. Is this correct?
Source:
http://www.cs.tut.fi/~jkorpela/HTML3.2/5.47.htmlSorry thinking of the size
Sorry thinking of the size attribute for a text field, to start with your hook would look like (given your module name is dojo)
Hopefully this will get you going.