Check this solution.... I took a button click function and add an id to the Drop Down List.
$( "#btnSelect" ).click(function() {
var ddl = $("#id1 option:selected").val();
var text = $("#txt1").val();
var final;
if(ddl=='0' && text=='')
{
alert('Select any one !');
return;
}
else if(ddl!='0' && text!='')
{
alert('You have to select only one !');
return;
}
else
{
if(ddl!='0') { final = ddl;}
else if (text !='') {final = text}
}
alert('Final Value is ' + final);
});
For on line trial go to
JSFiddle [
^]