You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Duncan McLean <du...@blueyonder.co.uk> on 2006/01/25 17:28:46 UTC

Custom validation in form

Hi

I have a partial forms definition which calls a server-side date checking
JS function (validateDate), which returns true or false depending on
validity of supplied string - this seems to pass validation in the form,
no matter what I enter (the function returns true/false correctly as
checked through log file).

How can I get the validation to work?

Snippet from form def:

		<fd:aggregatefield id="dob1" required="true">
			<fd:label>Date of Birth</fd:label>
			<fd:datatype base="string"/>
			<fd:validation>
		      <fd:javascript>

				  var tmp = validateDate(widget.getValue());
				  java.lang.System.out.println("true or false? " + tmp);
				  return tmp;

 		     </fd:javascript>
		    </fd:validation>

                       etc



Do I have to set the validation error against the dob1 widget? If so how
do I do this? Or am I doing this the wrong way?

Thanks

Duncan



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org