You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pankaj Gupta <pa...@hsc.com> on 2006/07/05 12:48:53 UTC

Validation giving strange problem - pl help

Hi All,

I am facing a strange problem and have no clue about it. As soon as I 
invoke my application, instead of the requested page I see a lot of 
weired code like:

* @param form The form validation is taking place on. */ function 
validateFloatRange(form) { var isValid = true; var focusField = null; 
var i = 0; var fields = new Array(); var formName = 
form.getAttributeNode("name"); oRange = eval('new ' + formName.value + 
'_floatRange()'); for (x in oRange) { var field = form[oRange[x][0]]; if 
((field.type == 'hidden' || field.type == 'text' || field.type == 
'textarea') && (field.value.length > 0) && field.disabled == false) { 
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; } /*$RCSfile: validateUtilities.js,v $ $Revision: 1.2 $ 
$Date: 2004/03/28 16:53:21 $ */ /** * This is a place holder for common 
utilities used across the javascript validation * **/ /*$RCSfile: 
validateByte.js,v $ $Revision: 1.9 $ $Date: 2004/03/28 16:53:21 $ */ /** 
* Check to see if fields are a valid byte. * Fields are not checked if 
they are disabled. *

Please suggest what can be the problem.

regards,
Pankaj

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org