Ajax Link In A FAPI tableselect Row I'm trying to add an ajax link to my tableselect rows and replace part of this form with ajax.

$options = array();
foreach ($result as $camp) {
    $options[$camp-&gt;uuid] = array(
        'select_link' =&gt; array('data' =&gt; array(
            '#type' =&gt; 'link',
            '#name' =&gt; 'select_link',
            '#title' =&gt; t('use'),
            '#href' =&gt; 'ajax_use_data_callback/nojs/', 
            '#attributes' =&gt; array(
                'class'=&gt;array(0=&gt;'use-ajax')
            ),
            '#ajax' =&gt; array(
                'wrapper' =&gt; 'selected-data-div',
                'method' =&gt; 'replace',
            ),
        )),

        ...

    );
}


This triggers an alert with a 404 error and the site's default html. How do I tell this ajax link to be handled like a regular ajax form element?
This can be solved by building a 'select' element with an option for each row id in the tableselect that gets an ajax link. Then we can add links to the tableselect row with '#markup' and use Drupal.behaviors to attach a function that sets the value of the select element and triggers its 'change' event. In the form building function, if $form_state['triggering_element']['#name'] is the new select element, $form_state['triggering_element']['#value'] is the one we want to process.

The select element could then be hidden and the in-row ajax links are still fairly clean. Of course this won't work if javascript is off.