Getting nodes related to a taxonomy term selecting from a drop down into another drop down I have a taxonomy drop down in a content type. Now when I select a particular taxonomy I want to show all nodes related to that taxonomy in another select box. 

How can I implement this? If I need to do using Ajax, how can I get all contents after selecting a taxonomy? I am new to Drupal. Is there any module available for this purpose?

Or Please tell me how to get all contents using taxonomy programmatically? I have also to sort via price in a particular content type itself.

I need to do this in Drupal 7. 

Thanks
Yes, you need to implement this using hook_form_alter() and #ajax. The following is an example code you could try. The field field_category and the table field_data_field_category would be your taxonomy field. The field_nodes would be your another drop-down where you want to list the selected nodes related to the selected taxonomy.

The example code would sort the nodes by content types. To sort price of each particular content type, you would need to join another table in the query, for example, field_data_field_price and add your price field to the order-by clause. HTH.

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    if( $form_id == 'your_node_form' ){

        $form['field_category']['und']['#ajax'] = array(
            // #ajax has two required keys: callback and wrapper.
            // 'callback' is a function that will be called when this element changes.
            'callback' =&gt; '_mymodule_ajax_dropdown_alter',
            // 'wrapper' is the HTML id of the page element that will be replaced.
            'wrapper' =&gt; 'replace_field_div',
        );

        $form['field_nodes'] = array(
            '#type'     =&gt; 'select',
            '#title'    =&gt; t('Nodes'),
            '#options'  =&gt; array('' =&gt; '- Select -'),
            '#required' =&gt; FALSE,
            '#prefix'   =&gt; '&lt;div id="replace_field_div"&gt;',
            '#suffix'   =&gt; '&lt;/div&gt;'
        );

        // An AJAX request calls the form builder function for every change.
        // We can change how we build the form based on $form_state.        
        if(isset($form_state['values']['field_category']) &amp;&amp; $form_state['values']['field_category']['und'][0]['tid'] ){
            # when the respective taxonomy is selected, get the nodes related to the selected taxonomy
            $tid = $form_state['values']['field_category']['und'][0]['tid'];

            $query = db_select('node', 'n');
            $query-&gt;join('field_data_field_category', 'c', 'n.nid = c.entity_id');
            $query-&gt;condition('n.status', 1, '=')
                    -&gt;condition('c.field_category_tid', $tid)
                    -&gt;fields('n', array('nid', 'title'))
                    -&gt;orderBy('n.type', 'ASC');
            $result = $query-&gt;execute();
            foreach($result as $row){       
                $form['field_nodes']['#options'][$row-&gt;nid] = $row-&gt;title;      
            }                           
        }else{ 
            # No taxonomy selected
            $form['field_nodes']['#options'] = array('' =&gt; '- Select -');
        }       
    }
}

function _mymodule_ajax_dropdown_alter($form, $form_state){
    return $form['field_nodes'];
}