Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: converted to 1.6 markup

I want a an argument in my xml field-element, for the max and min lenght length validation. i I have done it based on the dtd file bot it dont works. the validator doesnt but it doesn't work. The validator doesn't get the value. an so ich have an So I get a nullpointer exception.

how How must i I write the argument in the field element?

No Format
      <field property="name"
        depends="required,minlength,maxlength">
        <arg0 key="register.validate.name"/>
        <arg1 name="minlength"
              key="${var:minlength}" 
              resource="false"/>
        <arg1 name="maxlength"
              key="${var:maxlength}"
              resource="false"/>
        <var>
          <var-name>minlength</var-name>
          <var-value>1</var-value>
        </var>
        <var>
          <var-name>maxlength</var-name>
          <var-value>255</var-value>
        </var>
      </field>

Where:

  • Arg0 is the argument for all 3 rules - required, min & max len.
  • Arg1 name="minlength" is used by minlength
  • Arg1 name="maxlength" is used by maxlength