function lookup( val, id ) {
var sel = document.getElementById( id )
var found = false
if ( sel ) {
for ( var i = 0; i < sel.options.length; i++ ) {
if ( sel.options[ i ].value == val ) {
sel.options[ i ].selected = true
found = true
break
}
}
if ( !found ) {
alert( 'Unexpected/invalid value entered.' )
}
} else {
alert( 'Specified element not found. id="' + id + '"' )
}
}
|