Nodereference views and dynamic argument

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:

How to send argument to drupal_get_form()

This is how you send arguments to your own form when using drupal_get_form() in Drupal 6.x. This function has no required argument, but receives $form_state as first argument. Declare a first argument for $form_state and then your arguments, as many as you need.

function my_module_begin_form($form_state, $my_arg = array(), $another = "") {


$out = drupal_get_form('my_module_begin_form', $my_arg, $another);