Radio button change.

Radio button change.

Hi,
I need your help to implement the procedure that allows me to assign status to a student through radio buttons.
When set to Deferred or Transfered, it must automatically activate a dialog.
I tried different solutions, this is the last attempt, but it doen't work:

$ ('input: radio [name = status]'). Click (function () {
Alert ("stato ->" + $ ("# status"). Val ())

This is the html code:

<?php
     if ($row['stato'] == 'F' ||  $row['stato'] == "") 
     {
?>
         <input type='radio' name='stato' id='stato' value='F' checked='checked'  /> Frequentante 
         <input type='radio' name='stato' id='stato' value='R'  /> Ritirato 
         <input type='radio' name='stato' id='stato' value='T'  /> Trasferito
         <input type='radio' name='stato' id='stato' value='D'  /> Diplomato
<?php
     }else
       if ($row['stato'] == 'R')
       {
?>
         <input type='radio' name='stato' id='stato' value='F'   /> Frequentante 
         <input type='radio' name='stato' id='stato' value='R'  checked='checked'/> Ritirato 
         <input type='radio' name='stato' id='stato' value='T'  /> Trasferito
         <input type='radio' name='stato' id='stato' value='D'  /> Diplomato
<?php
         }else
            if ($row['stato'] == 'T')
            {
?>
                 <input type='radio' name='stato' id='stato' value='F'   /> Frequentante  
                 <input type='radio' name='stato' id='stato' value='R'  /> Ritirato 
                 <input type='radio' name='stato' id='stato' value='T'  checked='checked'/> Trasferito
                <input type='radio' name='stato' id='stato' value='D'  /> Diplomato   
<?php
         }else
            if ($row['stato'] == 'D')
            {
?>
                 <input type='radio' name='stato' id='stato' value='F'   /> Frequentante  
                 <input type='radio' name='stato' id='stato' value='R'  /> Ritirato 
                 <input type='radio' name='stato' id='stato' value='T'  /> Trasferito
                <input type='radio' name='stato' id='stato' value='D'  checked='checked'/> Diplomato
<?php       
     }
?>

Can anybody help me, please?
Thank you in advance

Tegatti