[TYPO3-dev] Custom TCA formeval
Jeff Segars
jsegars at alumni.rice.edu
Fri Jun 16 00:02:45 CEST 2006
Ingmar,
Thanks for the pointer. I actually had an earlier version of this
extension that I had been working from and I pulled the Core API
document out of CVS. I'm still not quite clear on whether what I'm
trying to do is possible though :)
I see how to perform an JS evaluation in returnFieldJS to change "value"
but is there a way to keep "value" intact and just trigger an error,
much like when a required field is missing?
On the PHP side of it, I know I can do $set=0 to keep $value from being
saved into the database, but this doesn't seem to trigger an error on
the backend form either.
It may not be possible, but I'm crossing my fingers and hoping it is :)
Thanks for your help!
Jeff
Functions from example extension:
function returnFieldJS() {
return '
return value + " [added by JS]";
';
}
function evaluateFieldValue($value, $is_in, &$set) {
return $value.' [added by PHP]';
}
Ingmar Schlecht wrote:
> Hi Jeff,
>
> the custom form evaluation functions are documented in the soon to be
> released revised TYPO3 Core API document.
>
> However, you can already test the functionality with this example
> extension that makes use of the Form Eval API:
>
> http://typo3.org/fileadmin/dl/T3X_example_extraevaluations-0_4_0-z-200603260125.t3x
>
> cheers
> Ingmar
>
> Jeff Segars schrieb:
>> I recently came across a great new feature in 4.0...the ability to
>> define custom evaluation functions for backend forms in both Javascript
>> and PHP. There are some details on the bugtracker at
>> http://bugs.typo3.org/view.php?id=1639.
>>
>> I can see how to change user submitted values using these functions but
>> I'm not clear on whether its possible to generate a form validation
>> errors with it. I'd like to be able to check input with my custom
>> evaluation, then display the yellow exclamation mark if I detect a
>> problem with the input.
>>
>> Any pointers on whether this is possible? (Ingmar, Thomas, etc?)
>>
>> Thanks,
>> Jeff
More information about the TYPO3-dev
mailing list