<html:javascript/>问题
<html:javascript formName= "LoginForm " />
写完这段代码jsp页面上就会出现一大段javascript代码
function validateFloatRange(form) { var isValid = true; var focusField = null; var i = 0; var fields = new Array(); oRange = new floatRange(); for (x in oRange) { var field = form[oRange[x][0]]; if ((field.type == 'text ' || field.type == 'textarea ') && (field.value.length > 0)) { var fMin = parseFloat(oRange[x][2]( "min ")); var fMax = parseFloat(oRange[x][2]( "max ")); var fValue = parseFloat(field.value); if (!(fValue > = fMin && fValue <= fMax)) { if (i == 0) { focusField = field; } fields[i++] = oRange[x][1]; isValid = false; } } } if (fields.length > 0) { focusField.focus(); alert(fields.join( '\n ')); } return isValid; } function validateByte(form) { var bValid = true; var focusField = null; var i = 0; var fields = new Array(); oByte = new ByteValidations(); for (x in oByte) { var field = form[oByte[x][0]]; if (field.type == 'text ' || field.type == 'textarea ' || field.type == 'select-one ' || field.type == 'radio ') { var value = ' '; // get field 's value if (field.type == "select-one ") { var si = field.selectedIndex; if (si > = 0) { value = field.options[si].value; } } else { value = field.value; } if (value.length > 0) { if (!isAllDigits(value)) { bValid = false; if (i == 0) { focusField = field; } fields[i++] = oByte[x][1]; } else { var iValue = parseInt(value); if (isNaN(iValue) || !(iValue > = -128 && iValue <= 127)) { if (i == 0) { focusField = field; } fields[i++] = oByte[x][1]; bValid = false; } } } } } if (fields.length > 0) { focusField.focus(); alert(fields.join( '\n ')); } return bValid; } function validateMaxLength(form) { var isValid = true; var focusField = null; var i = 0; var fields = new Array(); oMaxLength = new maxlength(); for (x in oMaxLength) { va