1 <p><label for="units">Units:</label>
2 <select id="unitselector" name="units">
3 <option values="centimeters"<% if units == 'centimeters' %>selected="selected"<% endif %>>centimeters</option>
4 <option value="inches"<% if units == 'inches' %>selected="selected"<% endif %>>inches</option>
8 <p><label for="pixel_width">Screen width (in pixels):</label>
9 <input type="text" name="pixel_width" value="<%= pixel_width %>" /></p>
11 <p><label for="unit_width"><em>Horizontal</em> screen width (in <span class="unittext">units</span>):</label>
12 <input type="text" name="unit_width" value="<%= unit_width %>" /></p>
15 // simple chunk of javascript to handle changes
16 var unit_selector = $("unitselector");
17 function change_unit_text() {
18 var text_spans = document.getElementsByClassName('unittext');
19 for (i = 0; i < text_spans.length; i++) {
20 var text_span = text_spans[i];
21 Element.update(text_span, unit_selector.value);
25 Event.observe(unit_selector, 'change', change_unit_text);