cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duncan McLean" <duncan_mcl...@blueyonder.co.uk>
Subject Custom validation in form
Date Wed, 25 Jan 2006 16:28:46 GMT
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


Mime
View raw message