FieldChecks.validateMinLengths()

2003-07-01 Thread Adam Hardy
I started using struts validator. I just copied a bunch of stuff from 
the struts example and started using that, and found that the minlength 
validation actually returns true when the text field is blank.

This was my first attempt and I was trying to make sure I had got the 
validator plug-in functioning correctly, so I actually spent a few hours 
hunting down the reason why my blank field was passing validation even 
though the minlength had been set to 1.

I discovered in the source code that this is normal behaviour - surely 
that can't be the case? I would expect a blank field to fail validation 
for minimum length. Or is this actually the case for reasons I'm not 
aware of?

Thanks
Adam
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FieldChecks.validateMinLengths()

2003-07-01 Thread Nicolas De Loof
I think this is the correct behaviour since blank fields have to be considered using 
the required rule.

You can use both required + minlength rules if field is mandatory.

Nico.



 I started using struts validator. I just copied a bunch of stuff from 
 the struts example and started using that, and found that the minlength 
 validation actually returns true when the text field is blank.
 
 This was my first attempt and I was trying to make sure I had got the 
 validator plug-in functioning correctly, so I actually spent a few hours 
 hunting down the reason why my blank field was passing validation even 
 though the minlength had been set to 1.
 
 I discovered in the source code that this is normal behaviour - surely 
 that can't be the case? I would expect a blank field to fail validation 
 for minimum length. Or is this actually the case for reasons I'm not 
 aware of?
 
 Thanks
 Adam
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FieldChecks.validateMinLengths()

2003-07-01 Thread David Graham
--- Adam Hardy [EMAIL PROTECTED] wrote:
 I started using struts validator. I just copied a bunch of stuff from 
 the struts example and started using that, and found that the minlength 
 validation actually returns true when the text field is blank.
 
 This was my first attempt and I was trying to make sure I had got the 
 validator plug-in functioning correctly, so I actually spent a few hours
 
 hunting down the reason why my blank field was passing validation even 
 though the minlength had been set to 1.
 
 I discovered in the source code that this is normal behaviour - surely 
 that can't be the case? I would expect a blank field to fail validation 
 for minimum length. Or is this actually the case for reasons I'm not 
 aware of?

This is actually a good thing :-).  Minlength will only fail if there is
some text in the control and it's less than the minimum length.  If you
want it to fail with no data you need to use the required validation.  By
separating these validations you can make a field optional and if the user
fills it in, it has to be more than minlength characters.

David


 
 Thanks
 Adam
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FieldChecks.validateMinLengths()

2003-07-01 Thread Adam Hardy
Oh. I see. But the client-side validation does not behave this way.

I have just max and min length specified, and with javascript on, I 
cannot submit if the field is blank.

David Graham wrote:
This is actually a good thing :-).  Minlength will only fail if there is
some text in the control and it's less than the minimum length.  If you
want it to fail with no data you need to use the required validation.  By
separating these validations you can make a field optional and if the user
fills it in, it has to be more than minlength characters.
David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FieldChecks.validateMinLengths()

2003-07-01 Thread David Graham
--- Adam Hardy [EMAIL PROTECTED] wrote:
 Oh. I see. But the client-side validation does not behave this way.
 
 I have just max and min length specified, and with javascript on, I 
 cannot submit if the field is blank.

Client and server checks should be the same in 1.1 final.  If you
generated the static javascript and stored it in a file, make sure you
regenerate it after upgrading to 1.1 final.

David

 
 David Graham wrote:
  This is actually a good thing :-).  Minlength will only fail if there
 is
  some text in the control and it's less than the minimum length.  If
 you
  want it to fail with no data you need to use the required validation. 
 By
  separating these validations you can make a field optional and if the
 user
  fills it in, it has to be more than minlength characters.
  
  David
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FieldChecks.validateMinLengths()

2003-07-01 Thread Adam Hardy
I shutdown and deleted my deploys and builds and recompiled and 
redeployed everything, and I have the html:javascript static=true tag in 
the staticJavascript.jsp which I link into my page with the script tag, 
so I am pretty confident I don't have any old version of the static 
javascript cached or generated anywhere. (I am on 1.1 final)

The javascript is still giving me must be min length validation errors 
when I try to submit a blank field though.

Should the static javascript taglib still be in a seperate file like in 
the example app?

Adam

David Graham wrote:
Client and server checks should be the same in 1.1 final.  If you
generated the static javascript and stored it in a file, make sure you
regenerate it after upgrading to 1.1 final.
David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FieldChecks.validateMinLengths()

2003-07-01 Thread Adam Hardy
formset
form name=sectionForm
  field property=id
depends=integer
arg0   key=sections.validate.id/
  /field
  field property=title
depends=minlength,maxlength
bundle=alternate
arg0   key=sections.validate.title/
arg1   key=${var:minlength} name=minlength
  resource=false/
arg2   key=${var:maxlength} name=maxlength
  resource=false/
var
  var-namemaxlength/var-name
  var-value16/var-value
/var
var
  var-nameminlength/var-name
  var-value2/var-value
/var
  /field
/form
  /formset
Copied more or less from the struts-example app

David Graham wrote:
What is your validation setup for that field and what are you entering
into it?  The struts-validator app seems to be working fine.
David

--- Adam Hardy [EMAIL PROTECTED] wrote:

I shutdown and deleted my deploys and builds and recompiled and 
redeployed everything, and I have the html:javascript static=true tag in

the staticJavascript.jsp which I link into my page with the script tag, 
so I am pretty confident I don't have any old version of the static 
javascript cached or generated anywhere. (I am on 1.1 final)

The javascript is still giving me must be min length validation errors

when I try to submit a blank field though.

Should the static javascript taglib still be in a seperate file like in 
the example app?

Adam

David Graham wrote:

Client and server checks should be the same in 1.1 final.  If you
generated the static javascript and stored it in a file, make sure you
regenerate it after upgrading to 1.1 final.
David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FieldChecks.validateMinLengths()

2003-07-01 Thread David Graham
Remove the field bundle attribute because that's not supported.  What
text are you typing into the input box?

David

--- Adam Hardy [EMAIL PROTECTED] wrote:
 formset
  form name=sectionForm
field property=id
  depends=integer
  arg0   key=sections.validate.id/
/field
field property=title
  depends=minlength,maxlength
  bundle=alternate
  arg0   key=sections.validate.title/
  arg1   key=${var:minlength} name=minlength
resource=false/
  arg2   key=${var:maxlength} name=maxlength
resource=false/
  var
var-namemaxlength/var-name
var-value16/var-value
  /var
  var
var-nameminlength/var-name
var-value2/var-value
  /var
/field
  /form
/formset
 
 Copied more or less from the struts-example app
 
 David Graham wrote:
  What is your validation setup for that field and what are you entering
  into it?  The struts-validator app seems to be working fine.
  
  David
  
  
  --- Adam Hardy [EMAIL PROTECTED] wrote:
  
 I shutdown and deleted my deploys and builds and recompiled and 
 redeployed everything, and I have the html:javascript static=true tag
 in
 
 the staticJavascript.jsp which I link into my page with the script
 tag, 
 so I am pretty confident I don't have any old version of the static 
 javascript cached or generated anywhere. (I am on 1.1 final)
 
 The javascript is still giving me must be min length validation
 errors
 
 when I try to submit a blank field though.
 
 Should the static javascript taglib still be in a seperate file like
 in 
 the example app?
 
 Adam
 
 David Graham wrote:
 
 Client and server checks should be the same in 1.1 final.  If you
 generated the static javascript and stored it in a file, make sure
 you
 regenerate it after upgrading to 1.1 final.
 
 David
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
  
  
  
  __
  Do you Yahoo!?
  SBC Yahoo! DSL - Now only $29.95 per month!
  http://sbc.yahoo.com
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FieldChecks.validateMinLengths()

2003-07-01 Thread Adam Hardy
I'm sorry, it was my fault. I had forgotten to replace the 
validator-rules.xml with the new version.

David Graham wrote:
Remove the field bundle attribute because that's not supported.  What
text are you typing into the input box?
David

--- Adam Hardy [EMAIL PROTECTED] wrote:

formset
form name=sectionForm
  field property=id
depends=integer
arg0   key=sections.validate.id/
  /field
  field property=title
depends=minlength,maxlength
bundle=alternate
arg0   key=sections.validate.title/
arg1   key=${var:minlength} name=minlength
  resource=false/
arg2   key=${var:maxlength} name=maxlength
  resource=false/
var
  var-namemaxlength/var-name
  var-value16/var-value
/var
var
  var-nameminlength/var-name
  var-value2/var-value
/var
  /field
/form
  /formset
Copied more or less from the struts-example app

David Graham wrote:

What is your validation setup for that field and what are you entering
into it?  The struts-validator app seems to be working fine.
David

--- Adam Hardy [EMAIL PROTECTED] wrote:


I shutdown and deleted my deploys and builds and recompiled and 
redeployed everything, and I have the html:javascript static=true tag
in

the staticJavascript.jsp which I link into my page with the script
tag, 

so I am pretty confident I don't have any old version of the static 
javascript cached or generated anywhere. (I am on 1.1 final)

The javascript is still giving me must be min length validation
errors

when I try to submit a blank field though.

Should the static javascript taglib still be in a seperate file like
in 

the example app?

Adam

David Graham wrote:


Client and server checks should be the same in 1.1 final.  If you
generated the static javascript and stored it in a file, make sure
you

regenerate it after upgrading to 1.1 final.

David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FieldChecks.validateMinLengths()

2003-07-01 Thread Adam Hardy
Hi David
is there any reason to suspect I am doing something with the resource 
string as well?

With the all-up-to-date version :) I get the correct validation message 
for the minvalue, but the maxvalue msg says:

Title cannot be greater than null characters

Any pointers?

Adam

Adam Hardy wrote:
I'm sorry, it was my fault. I had forgotten to replace the 
validator-rules.xml with the new version.

David Graham wrote:

Remove the field bundle attribute because that's not supported.  What
text are you typing into the input box?
David

--- Adam Hardy [EMAIL PROTECTED] wrote:

formset
form name=sectionForm
  field property=id
depends=integer
arg0   key=sections.validate.id/
  /field
  field property=title
depends=minlength,maxlength
bundle=alternate
arg0   key=sections.validate.title/
arg1   key=${var:minlength} name=minlength
  resource=false/
arg2   key=${var:maxlength} name=maxlength
  resource=false/
var
  var-namemaxlength/var-name
  var-value16/var-value
/var
var
  var-nameminlength/var-name
  var-value2/var-value
/var
  /field
/form
  /formset
Copied more or less from the struts-example app

David Graham wrote:

What is your validation setup for that field and what are you entering
into it?  The struts-validator app seems to be working fine.
David

--- Adam Hardy [EMAIL PROTECTED] wrote:


I shutdown and deleted my deploys and builds and recompiled and 
redeployed everything, and I have the html:javascript static=true tag


in

the staticJavascript.jsp which I link into my page with the script


tag,

so I am pretty confident I don't have any old version of the static 
javascript cached or generated anywhere. (I am on 1.1 final)

The javascript is still giving me must be min length validation


errors

when I try to submit a blank field though.

Should the static javascript taglib still be in a seperate file like


in

the example app?

Adam

David Graham wrote:


Client and server checks should be the same in 1.1 final.  If you
generated the static javascript and stored it in a file, make sure


you

regenerate it after upgrading to 1.1 final.

David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]