web/wp-includes/js/tinymce/utils/form_utils.js
branchwordpress
changeset 132 4d4862461b8d
parent 109 03b0d1493584
equal deleted inserted replaced
131:a4642baaf829 132:4d4862461b8d
     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