Source

webwork / src / test / com / opensymphony / webwork / views / jsp / ui / Formtag-2.txt

Full commit
<script type="text/javascript" src="/webwork/xhtml/validation.js"></script>
<form namespace="" id="myAction" name="myForm" onsubmit="submitMe(); customOnsubmit_myAction(); return validateForm_myAction();" action="/myAction.action" method="POST" enctype="myEncType" title="mytitle" accept-charset="UTF-8">
<table class="wwFormTable"> <tr>
    <td class="tdLabel"></td>
    <td>	<script type="text/javascript" language="javascript" src="/webwork/optiontransferselect/optiontransferselect.js"></script>
<table>
<tr><td>
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
</select></td></tr>
<tr><td>
		&nbsp;<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myAction_myUpDownSelectTag'));" />&nbsp;
		&nbsp;<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myAction_myUpDownSelectTag'));" />&nbsp;
		&nbsp;<input type="button" value="*" onclick="selectAllOptions(document.getElementById('myAction_myUpDownSelectTag'));" />&nbsp;
</td></tr>
</table>
</td>
</tr>
</table>
</form>


<script type="text/javascript">
	function customOnsubmit_myAction() {

		// Code that will auto select updownselect elements upon its containing form submission
			var updownselectObj = document.getElementById("myAction_myUpDownSelectTag");
			selectAllOptions(updownselectObj);
			selectUnselectMatchingOptions(updownselectObj, null, "unselect", false, "key");
	}
</script>
<script type="text/javascript">
    function validateForm_myAction() {
        form = document.getElementById("myAction");
        clearErrorMessages(form);
        clearErrorLabels(form);
        var errors = false;
        return !errors; }
</script>