+ <script type="text/javascript">
+ //<![CDATA[
+ $(document).ready(function(){
+ var selectedUnit = $("#units option:selected").attr("value");
+ var unitfields = $("#page_height,#page_width,#label_width,#label_height,#top_margin,#left_margin,#top_text_margin,#left_text_margin,#col_gap,#row_gap");
+ $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>");
+ $("#units").change(function(){
+ $(".unit").html(getUnit($(this).val()));
+ });
+ function getUnit(unit){
+ switch(unit){
+ case "POINT":
+ var unit = " pt";
+ break;
+ case "AGATE":
+ var unit = " ag";
+ break;
+ case "INCH":
+ var unit = " in";
+ break;
+ case "MM":
+ var unit = " mm";
+ break;
+ case "CM":
+ var unit = " cm";
+ break;
+ default:
+ var unit = "";
+ }
+ return unit;
+ }
+ });
+ //]]>
+ </script>