Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$$('#engrave,#engrave2').invoke('observe','keyup', function(evt){
var limit = 20;
if($F(this).length < limit){
var txt = this.getValue();
var elm;
if(elm = $(this.readAttribute('id') + 'Out')){
elm.down('p').update(txt)
}
}else{
this.setValue($F(this).substr(0,limit));
alert('Too much text!');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment