Q:

enable and disable using selectbox change

I don't know how to enable and disable a text field using select box option.   
Maybe I wrote this totally wrong in the code below.
If I did, please tell me correct code.
<body>
<table width="500" border="1">
  <form style="text-align:center" id="form1" name="form1" method="post" action="">
    <tr>
      <th width="32" nowrap="nowrap">Status</th>
      <th width="32" nowrap="nowrap">Runs</th>
      <th width="16" nowrap="nowrap">6</th>
    </tr>
<?php
$('#Status1').change(function(){
var theVal = $('#Status1').val();
switch(theVal){
    case'0':
        $('#Runs1').prop('disabled', true);
        break;
    case'1':
        $('#Runs1').prop('disabled', false);
        break;
    case'2':
        $('#Runs1').prop('disabled', true);
        break;
    }
});
?>
<tr>
 <td align='center'>
   <select id='Status1'><option value='0'>Not Playing</option><option value='1'>Playing</option><option value='2'>Out</option></select></td>
 <td align='center'>
   <input style='font-weight:bold; background:#FFFFFF; text-align:right; color:#000000;' disabled='disabled' name='Runs1' type='text' id='Runs1' size='5' maxlength='5' value='' />    
 </td>
</tr>
</form>
</table>
</body>

A:

The code for enabling/disabling the #Run1 input box is nested between PHP tags (server side), but this code is written in javascipt (client-side).
<body>
<table width="500" border="1">
  <form style="text-align:center" id="form1" name="form1" method="post" action="">
    <tr>
      <th width="32" nowrap="nowrap">Status</th>
      <th width="32" nowrap="nowrap">Runs</th>
      <th width="16" nowrap="nowrap">6</th>
    </tr>
<script type="text/javascript">
$('#Status1').change(function(){
var theVal = $('#Status1').val();
switch(theVal){
    case'0':
        $('#Runs1').prop('disabled', true);
        break;
    case'1':
        $('#Runs1').prop('disabled', false);
        break;
    case'2':
        $('#Runs1').prop('disabled', true);
        break;
    }
});
</script>
<tr>
 <td align='center'>
   <select id='Status1'><option value='0'>Not Playing</option><option value='1'>Playing</option><option value='2'>Out</option></select></td>
 <td align='center'>
   <input style='font-weight:bold; background:#FFFFFF; text-align:right; color:#000000;' disabled='disabled' name='Runs1' type='text' id='Runs1' size='5' maxlength='5' value='' />    
 </td>
</tr>
</form>
</table>

