help with requiredIf validation

2003-10-10 Thread Mick Knutson
I have the following requiredIf that does not seem to actually work:

field  property=phone1
 depends=required,minlength,maxlength
arg0 key=form.phone1/
  arg1 name=maxlength key=${var:maxlength}
resource=false/
var
var-nameminlength/var-name
var-value2/var-value
/var
var
var-namemaxlength/var-name
var-value32/var-value
/var
/field
field  property=phone1type
depends=requiredif
arg0 key=form.phone1type/
var
var-namefield[0]/var-name
var-valuephone1/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueNOTNULL/var-value
/var
/field

field  property=phone2
 depends=minlength,maxlength
arg0 key=form.phone1/
  arg1 name=maxlength key=${var:maxlength}
resource=false/
var
var-nameminlength/var-name
var-value2/var-value
/var
var
var-namemaxlength/var-name
var-value32/var-value
/var
/field
field  property=phone2type
depends=requiredif
arg0 key=form.phone2type/
var
var-namefield[0]/var-name
var-valuephone2/var-value
/var
var
var-namefieldTest[0]/var-name
var-valueNOTNULL/var-value
/var
/field

I have tried amking the phone reuired, and also not having the phone
required.
Here are the HTML elements. 1 is a text field, the other is a drop down:

html:text property=phone1 size=32 maxlength=32 /

then the dropdown is in a tile for re-usabilty:
html:select property='%= beanName + type %' 
html:option value= key=form.select/
html:option value=home key=form.phone.type.home /
html:option value=work key=form.phone.type.work /
html:option value=fax key=form.phone.type.fax /
html:option value=sms key=form.phone.type.sms /
html:option value=mobile key=form.phone.type.mobile /
html:option value=pager key=form.phone.type.pager /
/html:select

Is the fact that the form.select option is ?

---
Thanks
Mick Knutson

The world is a playground...Play Hard, Play Smart.
Visit  http://www.YourSoS.com to learn how our Personal Emergency Alert 
Contact System can help you Play Smart.

+00 1 (708) 570-2772 Fax
MSN: mickknutson
ICQ: 316498480
ICQ URL: http://wwp.icq.com/316498480

---

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



Help with requiredif validation

2003-06-11 Thread Brian McSweeney
Hi all,

I'd like to use requiredif to validate some fields as follows:

on my jsp I have a checkbox, eg supplier,

if this checkbox is checked, then I want another field, eg name to be required.
I've tried to set this up in my validation.xml file as follows:

  field property=name
 depends=requiredif

  arg0 key=validateForm.name/
  arg0
  name=requiredif
  key=A name is
  resource=false
  /
  var
var-namevalidateForm.supplier/var-name
var-valuetrue/var-value
  /var

however it doesn't seem to be working at all.
Any ideas?
thanks,
Brian

PS - other fields are being validated correctly.

RE: Help with requiredif validation

2003-06-11 Thread Suresh Babu
Try this

 arg1
  name=requiredif
  key=A name is
  resource=false
  /


 --
 From: Brian McSweeney[SMTP:[EMAIL PROTECTED]
 Reply To: Struts Users Mailing List
 Sent: Wednesday, June 11, 2003 9:36 PM
 To:   Struts Users Mailing List
 Subject:  Help with requiredif validation
 
 Hi all,
 
 I'd like to use requiredif to validate some fields as follows:
 
 on my jsp I have a checkbox, eg supplier,
 
 if this checkbox is checked, then I want another field, eg name to be
 required.
 I've tried to set this up in my validation.xml file as follows:
 
   field property=name
  depends=requiredif
 
   arg0 key=validateForm.name/
   arg0
   name=requiredif
   key=A name is
   resource=false
   /
   var
 var-namevalidateForm.supplier/var-name
 var-valuetrue/var-value
   /var
 
 however it doesn't seem to be working at all.
 Any ideas?
 thanks,
 Brian
 
 PS - other fields are being validated correctly.
 

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