当从选择字段中选择一个选项时,使用jquery输出javascript

I have the following select field :

         echo '<select id="projects" name="project">';
            if(mysqli_num_rows($res)!=0)
            {   while(list($id,$title)=mysqli_fetch_row($res))

                {   
                echo '<option value='.$id.'>'.$title.'</option>';
                }
            }
            else
            {
                echo '<option>No projects alloted</option>';
            }
            echo '</select>';

What I want to do on selecting an option is use the selected id to generate another java script displaying a date range calendar which I already have. Then run a query referencing the selected project id and the start and end dates. I want to achieve this using jquery but don't know how to output another calendar javascript and the form that will store the selected values and at the same time also store the selected option. Can you please point me in the right direction.

you can selected project id by $('#projects').val() and the calender value by$('calenderId').val().Then u can post these values by ajax Post to generate the query that you want