<script type="text/javascript" src="/struts/xhtml/validation.js"></script>
<script type="text/javascript "src="/struts/utils.js"></script>
<form id="doubleValidationAction" name="myForm" onsubmit="submitMe(); return validateForm_doubleValidationAction();" action="/doubleValidationAction.action" method="post" enctype="myEncType" title="mytitle" accept-charset="UTF-8" onreset="clearErrorMessages(this);clearErrorLabels(this);">
<table class="wwFormTable"> <tr>
    <td class="tdLabel"></td>
    <td class="tdInput">	<script type="text/javascript" src="/struts/optiontransferselect.js"></script>
<table>
<tr><td>
<select name="myUpDownSelectTag" size="5" id="doubleValidationAction_myUpDownSelectTag" multiple="multiple">
</select>
<input type="hidden" id="__multiselect_doubleValidationAction_myUpDownSelectTag" name="__multiselect_myUpDownSelectTag"value=""/>
</td></tr>
<tr><td>
		&nbsp;<input type="button" value="^" onclick="moveOptionUp(document.getElementById('doubleValidationAction_myUpDownSelectTag'), 'key', '');" />&nbsp;
		&nbsp;<input type="button" value="v" onclick="moveOptionDown(document.getElementById('doubleValidationAction_myUpDownSelectTag'), 'key', '');" />&nbsp;
		&nbsp;<input type="button" value="*" onclick="selectAllOptions(document.getElementById('doubleValidationAction_myUpDownSelectTag'), 'key', '');" />&nbsp;
</td></tr>
</table>
</td>
</tr>
</table>
</form>


<script type="text/javascript">
	var containingForm = document.getElementById("doubleValidationAction");
	StrutsUtils.addEventListener(containingForm, "submit",
			function(evt) {
				var updownselectObj = document.getElementById("doubleValidationAction_myUpDownSelectTag");
				selectAllOptionsExceptSome(updownselectObj, "key", "");
			}, true);
</script>

<script type="text/javascript">
    function validateForm_doubleValidationAction() {
        var getFieldValue = function(field) {
            var type = field.type ? field.type : field[0].type;
            if(type === 'select-one' || type === 'select-multiple') {
                return (field.selectedIndex === -1 ? "" : field.options[field.selectedIndex].value);
            } else if(type === 'checkbox' || type === 'radio') {
                if(!field.length) {
                    field = [field];
                }
                for(var i = 0; i < field.length; i++) {
                    if(field[i].checked) {
                        return field[i].value;
                    }
                }
                return"";
            }
            return field.value;
        }
        form = document.getElementById("doubleValidationAction");
        clearErrorMessages(form);
        clearErrorLabels(form);
        var errors = false;
        var continueValidation = true;
        //field name: myUpDownSelectTag
        //validator name: double
        if(form.elements['myUpDownSelectTag']) {
            field = form.elements['myUpDownSelectTag'];
            var error = "bar must be between 6000.1 and 10000.1.";
            var fieldValue=getFieldValue(field);
            if(continueValidation && fieldValue !== null) {
                var value = parseFloat(fieldValue);
                if(value < 6000.1 || value>10000.1 || false || false){
                    addError(field, error);
                    errors=true;
                }
            }
        }
    return !errors;
    }
</script>