cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Merico Raffaele <>
Subject AW: More control over Cform Date Conversion
Date Wed, 04 Feb 2009 08:46:01 GMT
Hi Edward

To access the entered value in a CForm I use the following construct based
on a personal server side javascript function.

<fd:field id="form_bis" required="false">
	<fd:datatype base="date">
                	return checkFormInputDate(widget);

function checkFormInputDate (widget, regExpValidation,
	var enteredValue = new


-----Urspr√ľngliche Nachricht-----
Von: Edward Elhauge [] 
Gesendet: Mittwoch, 4. Februar 2009 02:05
Betreff: [?? Probable Spam] More control over Cform Date Conversion


I've run into a problem where my users want more detailed control over
Date field validation. In the version that we're running (2.1.8)
we don't have a "lenient" attribute for base="date" widgets.

So the user can type in "33/60/9z" as a date, which get converted into
"10/30/2011". Not what was expected.

What I'd like would be to a small:
  <fd:validation> <fd:javascript>
  </fd:javascript> </fd:validation>
section to throw an error in those cases.

Unfortunately this.value inside that javascript callback is already in a
Date format.

My question is:
  How do I get access to the users original text input
  within the fd:validation section?

  If there is no way to get access to the raw text, do I need to write
  my own validator to replace "FormattingDateConvertor" ?

        Edward Elhauge <>
"The right dose differentiates a poison and a remedy." -- Paracelsus (1493 -

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message