Re: {Validator] Required Fields
Rob Leland wrote: Jerry Jalenak wrote: Has Validator changed in its use of 'required'? I pulled down the 20021008 build a couple of weeks ago, and found that Validator is now 'requiring' all of my form fields even when I don't specify the required parameter. Looking a little further at the CVS logs a patch to the validator-rules.xml was applied on July 17 2002, that when checking for a value that changed the code from: if (!iValue || !(iValue = -128 iValue = 127)) { to if (isNaN(iValue) || !(iValue = -128 iValue = 127)) { This is done in about 8 places in the file. This could be causing the difference in behaviour, try reverting the code to !iValue. Let me us know if the behaviour returns to what it was before. -Rob Eeep! Don't do that... The problem is the ole depends=required for all the common validator types in validation-rules.xml. Try removing them and see if it works better (until we can get them pulled out of the base version in struts.) What happened is that Commons Validator got fixed, and the depends=required that had been in the rules forever started working. Everyone who's sick of hearing about depends=required, raise their hands :-) James -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: FW: {Validator] Required Fields
I'm replying to the mailing list in case someone else comes across this In the provided validator-rules.xml file, all of the validator definitions have a 'depends=required' attribute. This was the cause of my problem, as in my application-rules.xml, I was only specifying 'depends=mask' - the 'mask' definition had the 'required' attribute. I copied the 'mask' definition from validator-rules.xml, pasted it into my application-rules.xml, and removed the depend= parameter. Tested it this morning and everything is back to normal. One thing I don't understand is, why would all of the definitions in validator-rules.xml have the 'depend=required' attribute? I would think the application designer would want to be able to specify which fields are required, etc. and not have validator make the choice for him/her Jerry -Original Message- From: James Turner [mailto:turner;blackbear.com] Sent: Monday, October 21, 2002 4:43 PM To: Jerry Jalenak Subject: Re: FW: {Validator] Required Fields At 05:02 PM 10/21/2002, you wrote: James, I hate to bother you like this, but I'm stuck and can't seem to get an answer from the mailing list. Maybe it's something obvious, but I can't find it. In my validator-rules.xml, I have a field that is NOT required with a mask - i.e. if and only if something is there do I want the validation to happen, and then it must match the mask value. With the 20021008 nightly build though, Validator is returning a 'field is required' message. I've searched the archives and bugzilla, but haven't found a matching hit for this. Do you know if Validator has changed in how the 'required' attribute is No problem at all, Make sure that in the definition of the mask validator, it doesn't depend on required As distributed with Struts, the vanilla rules all have a depends=required in them. James Thanks in advance! Jerry -Original Message- From: Jerry Jalenak Sent: Monday, October 21, 2002 2:00 PM To: '[EMAIL PROTECTED]' Subject: {Validator] Required Fields Has Validator changed in its use of 'required'? I pulled down the 20021008 build a couple of weeks ago, and found that Validator is now 'requiring' all of my form fields even when I don't specify the required parameter. I did a quick check in the archives but didn't see anything immediately. Has anyone else come across this? Is this fixed in a newer build? TIA Jerry Jalenak Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: FW: {Validator] Required Fields
Jerry Jalenak wrote: One thing I don't understand is, why would all of the definitions in validator-rules.xml have the 'depend=required' attribute? I would think the application designer would want to be able to specify which fields are required, etc. and not have validator make the choice for him/her Maybe someone assumed that you would never want a field to be (blank or valid). Some fields need to be validated only if they contain a value. Can one of the developers comment on this? Thanks, A. -- Adam Sherman Software Developer Teach and Travel Inc. +1.613.241.3103 -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: FW: {Validator] Required Fields
You do realize that you have full liberty to define your own constraints, right? Adam Sherman wrote: Jerry Jalenak wrote: One thing I don't understand is, why would all of the definitions in validator-rules.xml have the 'depend=required' attribute? I would think the application designer would want to be able to specify which fields are required, etc. and not have validator make the choice for him/her Maybe someone assumed that you would never want a field to be (blank or valid). Some fields need to be validated only if they contain a value. Can one of the developers comment on this? Thanks, A. -- Eddie Bush -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: FW: {Validator] Required Fields
Eddie, Yeah, I do - and I do this alot. I've written several 'custom' validate routines and use them without any problems. My question/concern is to the motive behind having the default validator-rules.xml always have the 'depend=required' attribute. As Adam pointed out, some fields only need to be validated if they contain a value. Unless someone overrides the default validator-rules or writes a custom method, there is no way to do this - using mask, min, max, etc. will also force a 'required' condition... Jerry -Original Message- From: Eddie Bush [mailto:ekbush;swbell.net] Sent: Tuesday, October 22, 2002 8:31 AM To: Struts Users Mailing List Subject: Re: FW: {Validator] Required Fields You do realize that you have full liberty to define your own constraints, right? Adam Sherman wrote: Jerry Jalenak wrote: One thing I don't understand is, why would all of the definitions in validator-rules.xml have the 'depend=required' attribute? I would think the application designer would want to be able to specify which fields are required, etc. and not have validator make the choice for him/her Maybe someone assumed that you would never want a field to be (blank or valid). Some fields need to be validated only if they contain a value. Can one of the developers comment on this? Thanks, A. -- Eddie Bush -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: FW: {Validator] Required Fields
Point noted :-) I'll let someone else explain what the rationale was for doing that. I don't know. I am aware that there is change taking place in commons-validator, and also in the struts-specific validator, but I couldn't really speak to what changes have been effected by that change. Jerry Jalenak wrote: Eddie, Yeah, I do - and I do this alot. I've written several 'custom' validate routines and use them without any problems. My question/concern is to the motive behind having the default validator-rules.xml always have the 'depend=required' attribute. As Adam pointed out, some fields only need to be validated if they contain a value. Unless someone overrides the default validator-rules or writes a custom method, there is no way to do this - using mask, min, max, etc. will also force a 'required' condition... Jerry -- Eddie Bush -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
{Validator] Required Fields
Has Validator changed in its use of 'required'? I pulled down the 20021008 build a couple of weeks ago, and found that Validator is now 'requiring' all of my form fields even when I don't specify the required parameter. I did a quick check in the archives but didn't see anything immediately. Has anyone else come across this? Is this fixed in a newer build? TIA Jerry Jalenak Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: {Validator] Required Fields
Jerry Jalenak wrote: Has Validator changed in its use of 'required'? I pulled down the 20021008 build a couple of weeks ago, and found that Validator is now 'requiring' all of my form fields even when I don't specify the required parameter. I did a quick check in the archives but didn't see anything immediately. Has anyone else come across this? Is this fixed in a newer build? I have started fixing a few of the bugs in Validator but I am unfamilar with how it worked before. James Turner has a bug report in to remove 'required' the Bug is 13526, take a look at it. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13526 However there will need to be some changes to the basic validator-rules.xml. -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: {Validator] Required Fields
Rob Leland wrote: Jerry Jalenak wrote: Has Validator changed in its use of 'required'? I pulled down the 20021008 build a couple of weeks ago, and found that Validator is now 'requiring' all of my form fields even when I don't specify the required parameter. Looking a little further at the CVS logs a patch to the validator-rules.xml was applied on July 17 2002, that when checking for a value that changed the code from: if (!iValue || !(iValue = -128 iValue = 127)) { to if (isNaN(iValue) || !(iValue = -128 iValue = 127)) { This is done in about 8 places in the file. This could be causing the difference in behaviour, try reverting the code to !iValue. Let me us know if the behaviour returns to what it was before. -Rob -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org