formatting javascript code for select sample type