Theme a ahah autocomplete dropdown list
In some themes you have to style the dropdownbox and it can be hard to catch it in Firebug.
In some themes you have to style the dropdownbox and it can be hard to catch it in Firebug.
When using views as filter and need a dynamic argument set you can't use autocomplete widget type because it uses a pre-default value that you cant change in form_alter or after_build.
If you change the widget to Select list then you can use both form_alter and after_build to set the advanced_view_args item based on arg etc.
Same goes for using PHP field in views to set a default PHP based argument, it can't get the arg list you like to have (node/[nid]/..). The arg list looks like this when using autocomlete and PHP filed:
This is how to set an attribute like read only on a CCK autocomplete field programmatically. You have to add a after_build function to execute the below code
<?php
/**
* After build function
*/
function content_log_after_build($form_element, &$form_state){
$form_element['field_l_reference'][0]['nid']['nid']['#attributes']['readonly'] = 'readonly';
}
?>
To style it
input[readonly="readonly"] {
background-color: #EEEEEE;
}
You know how to create a module and that it's easier to add a autocomplete field like node reference or user reference to an existing content type with CCK.
When you have your on module you can create an autocomplete field to any field of the database