[Typo3-dev] Eval of TCA field with JavaScript

Franz Holzinger franz at fholzinger.com
Wed Mar 30 15:59:34 CEST 2005


Hello Thomas

> I have an input field in the TCA and I want to evaluate the input with 
> my own JavaScript. For example that only specific values can be inserted 
> depending on other fields in the TCA.
> 
> There must be a way. The date is an example of what I basicly want to do.

Have a look into the wizard_colorpicker.php and see the fieldChangeFunc.

I hope this could do the job.

$PA['fieldChangeFunc']
$PA['fieldChangeFunc']['alert']=$alertMsgOnChange; (in 
t3lib\class.t3lib_tceforms.php)

/**
  * JavaScript code used for input-field evaluation.
  *
  * 		Example use:
  *
  * 		$msg.='Distribution time (hh:mm dd-mm-yy):<br /><input type="text" 
name="send_mail_datetime_hr" 
onchange="typo3FormFieldGet(\'send_mail_datetime\', \'datetime\', \'\', 
0,0);"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' /><input type="hidden" 
value="'.time().'" name="send_mail_datetime" /><br />';
  * 		$this->extJSCODE.='typo3FormFieldSet("send_mail_datetime", 
"datetime", "", 0,0);';
  *
  * 		... and then include the result of this function after the form
  *
  * @param	string		The identification of the form on the page.
  * @return	string		A <script></script> section with JavaScript.
  */
function JSbottom($formname='forms[0]')	{


Franz




More information about the TYPO3-dev mailing list