equal
deleted
inserted
replaced
1 /** |
1 /** |
2 * $Id: form_utils.js 996 2009-02-06 17:32:20Z spocke $ |
2 * $Id: form_utils.js 1184 2009-08-11 11:47:27Z spocke $ |
3 * |
3 * |
4 * Various form utilitiy functions. |
4 * Various form utilitiy functions. |
5 * |
5 * |
6 * @author Moxiecode |
6 * @author Moxiecode |
7 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. |
7 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. |
90 } |
90 } |
91 |
91 |
92 function getSelectValue(form_obj, field_name) { |
92 function getSelectValue(form_obj, field_name) { |
93 var elm = form_obj.elements[field_name]; |
93 var elm = form_obj.elements[field_name]; |
94 |
94 |
95 if (elm == null || elm.options == null) |
95 if (elm == null || elm.options == null || elm.selectedIndex === -1) |
96 return ""; |
96 return ""; |
97 |
97 |
98 return elm.options[elm.selectedIndex].value; |
98 return elm.options[elm.selectedIndex].value; |
99 } |
99 } |
100 |
100 |