protected function getInlineJavaScriptValidationCode(Field $field, $validationName, Validation $validatorConfiguration)
    {
        $javaScriptValidationName = GeneralUtility::quoteJSvalue($validationName);
        $validatorName = addslashes($validatorConfiguration->getClassName());
        $validatorConfigurationFinal = $this->getValidationConfiguration($field, $validationName, $validatorConfiguration);
        $validatorConfigurationFinal = $this->handleValidationConfiguration($validatorConfigurationFinal);

        return <<<JS
                /*
                 * Validation rule "$validationName"
                 */
                field.addValidation($javaScriptValidationName, '$validatorName', $validatorConfigurationFinal);

JS;
    }
protected function getInlineJavaScriptValidationCode(Field $field, $validationName, Validation $validatorConfiguration)
    {
        $javaScriptValidationName = GeneralUtility::quoteJSvalue($validationName);
        $validatorName = addslashes($validatorConfiguration->getClassName());
        $validatorConfigurationFinal = $this->getValidationConfiguration($field, $validationName, $validatorConfiguration);
        $validatorConfigurationFinal = $this->handleValidationConfiguration($validatorConfigurationFinal);

        return <<<JS
                /*
                 * Validation rule "$validationName"
                 */
                field.addValidation($javaScriptValidationName, '$validatorName', $validatorConfigurationFinal);

JS;
    }
protected function getInlineJavaScriptValidationCode ( Field $ field , $ validationName , Validation $ validatorConfiguration ) { $ javaScriptValidationName = GeneralUtility :: quoteJSvalue ( $ validationName ) ; $ validatorName = addslashes ( $ validatorConfiguration -> getClassName ( ) ) ; $ validatorConfigurationFinal = $ this -> getValidationConfiguration ( $ field , $ validationName , $ validatorConfiguration ) ; $ validatorConfigurationFinal = $ this -> handleValidationConfiguration ( $ validatorConfigurationFinal ) ; return  <<<JS
                /*
                 * Validation rule "$validationName"
                 */
                field.addValidation($javaScriptValidationName, '$validatorName', $validatorConfigurationFinal);

JS ; }
Generates the JavaScript code to add a validation rule to a field.

@param Field      $field
@param string     $validationName         The name of the validation rule.
@param Validation $validatorConfiguration Contains the current validator configuration.
@return string
Generates the JavaScript code to add a validation rule to a field .