views ajax form alter
i finally worked this one out, I strppied the form right back and removed all the states and got the ajax call working first. This was a bit of a hack as I had to access the $_GET variable directly and using the following line I was able to check whether or not the page had already been searched.

if(isset($_GET['line_2'])) {
  $line_2_selected = $_GET['line_2'];
}
else{
$line_2_selected = isset($form_state['values']['line_2']) ? $form_state['values']['line_2'] : key($doc_line2_options);
}


After this the problem was either having the ajax selectively removed ot depending on the values in the parent checkboxes. What I actually did was add the same list twice and then disable one or the other depending on the value in the first checkbox. Doing this greatly reduced the complexity of the states array.

$form['line'] = array(
  '#type' =&gt; 'radios',
  '#options' =&gt; $doc_line_options,
  '#default_value' =&gt; $line_selected,
  '#title' =&gt; '',
  '#prefix' =&gt; '&lt;div id="lines-dropdown-replace"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;',
  '#states' =&gt; array(
    'enabled' =&gt; array(
      ':input[name="type"]' =&gt; array('value' =&gt; 31)
    ),
    'visible' =&gt; array(
      ':input[name="type"]' =&gt; array('value' =&gt; 31)
      ),
  ),
);

$form['line_2'] = array(
  '#type' =&gt; 'radios',
  '#options' =&gt; $doc_line2_options,
  '#default_value' =&gt; $line_2_selected,
  '#title' =&gt; '',
  '#prefix' =&gt; '&lt;div id="lines-dropdown-replace"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;',      
  '#ajax' =&gt; array(
    'callback' =&gt; 'uk_general_forms_documents_products',
    'wrapper' =&gt; 'products-dropdown-replace',
    ),
  '#states' =&gt; array(        
    'enabled' =&gt; array(
      ':input[name="type"]' =&gt; array('value' =&gt; 29)
      ),
    'visible' =&gt; array(
      ':input[name="type"]' =&gt; array('value' =&gt; 29)
      ),
    )
  );


The previous ajax functions all worked as expected.