Also in der JS Datei habe ich versucht eine Funktion zu implementieren:
Code:
/**
* Input Count
*/
$.noConflict();
( function ( $ ) {
$.fn.eghInputcount = function ( options ) {
// Settings
var settings = $.extend( {
numberChats : 100,
errorMessage : 'Die maximale Zeichenanzahl ist erreicht.'
}, options || {});
countChars(this);
/**
* count Charts
* @param object
*/
function countChars( object ) {
object.keyup(function() {
// Count
// var inputLength=$(this).length;
var input = object.val().length;
// Controll Lengt
if ( input >= 140 ) {
// Alert
alert('Bitte verwenden Sie nicht mehr wie 140 Zeichen!');
}
});
}
}
}) ( jQuery );
Und dann wird quasi wenn die Funktion aufgerufen werden soll, folgendes ins HTML Injected:
Code:
<script type="text/javascript">
jQuery( document ).ready(function() {
$('#ctrl_ce_egh_plaintext').eghInputcount({
});
});
</script>
Das ganze ist noch nicht ganz fertig programmiert, aber ich wollte einfach mal erst schauen ob mein gedachter Weg überhaupt funktioniert.
Ne Idee?
Lesezeichen