<script type="text/javascript"> function set_select(value) { if ((value == '3') .... } set_select(<?php echo $row['type']; ?>) </script>