You can simplify your code because your select is not "multiple".
Code:
$(document).ready(function(e) {
$("#myOption").change(function(){
var textval = $(this).val();
$('input[name=student_mark]').val(textval);
if(textval!="") {
myTestForm.student_mark.disabled=true; // if selecta value , text field readonly
} else {
myTestForm.student_mark.disabled=false; // if not selecta value , text field read/write
}
});
});