Hello all

I'm trying to use ValidWhen from Struts without sucess. I tried everithing is possible, but it doesn't work. I have a radio button and a text field. My validation rule is: textfield is mandatory if some option of my radio is cheked. See bwlow.
Is there something wrong? Any help is welcome.
Thanks

My JSP is:

<html:radio property="tipoDivisao" styleId="tipoDivisao" value="P">
<html:radio property="tipoDivisao" styleId="tipoDivisao" value="I">
<html:text property="qtPartes" size="3" maxlength="3" styleId="qtPartes" disabled="true"/>

My validation.xml:
<form name="pdfForm">
           <field property="qtPartes" depends="integer,intRange,validwhen">
              <arg0 key="index.qtPartes"/>
              <arg1 name="intRange" key="${var:min}" resource="false"/>
              <arg2 name="intRange" key="${var:max}" resource="false"/>
              <var>
                <var-name>min</var-name>
                <var-value>1</var-value>
              </var>
              <var>
                <var-name>max</var-name>
                <var-value>999</var-value>
              </var>
              <var>
                <var-name>test</var-name>
<var-value>( (tipoDivisao != "I") or (qtPartes != null) )</var-value>
              </var>
           </field>
...

In generated page I have:

function validatePdfForm(form) { if (bCancel) return true; else var formValidationResult; formValidationResult = validateInteger(form) && validateRequired(form) && validateIntRange(form); return (formValidationResult == 1); }


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

Reply via email to